{"id":256,"date":"2015-11-28T16:34:01","date_gmt":"2015-11-28T15:34:01","guid":{"rendered":"http:\/\/itso.dk\/?p=256"},"modified":"2015-12-13T22:18:43","modified_gmt":"2015-12-13T21:18:43","slug":"make-a-script-for-cleaning-google-chrome-and-set-back-to-a-predefined-setup","status":"publish","type":"post","link":"https:\/\/blog.itso.dk\/?p=256","title":{"rendered":"Make a script for cleaning Google chrome, and set back to a predefined setup"},"content":{"rendered":"<p>So I wrote small this script, we needed it for our laptops at work, they have a single user account for simplicity.<br \/>\nWhen our students sign in to google.com, their username is keept, which makes it problematic for user other students to sign in if not cleaned from Chrome.<\/p>\n<p>This script restores chrome to default choosen settings.<\/p>\n<p style=\"padding-left: 30px;\">#!\/bin\/sh<br \/>\n# This script will clean Google Chrome and extract settings from archive<br \/>\necho &#8220;Lukker Google Chrome&#8221;<br \/>\npkill -u superbruger chrome<br \/>\nsleep 2<br \/>\necho &#8220;Sletter filer&#8221;<br \/>\nrm -rf ~\/.cache\/google-chrome<br \/>\nrm -rf ~\/.config\/google-chrome<br \/>\necho &#8220;Indstiller Google Chrome til standart&#8221;<br \/>\nsleep 1<br \/>\ncd ~\/.config\/<br \/>\ntar xf chrome-default.tar.gz<\/p>\n<p>This scripts creates a file called ~\/.config\/chrome-default.tar.gz from the content of ~\/.config\/google-chrome &#8211; If exist rename older backup.<\/p>\n<p style=\"padding-left: 30px;\">#!\/bin\/sh<br \/>\n# This file creates a backup of google chrome config folder, if backup exist, then move old backup with to backupfile+date<br \/>\nNOW=$(date +%Y-%m-%d_%H.%M.%S)<br \/>\nFILENAME=chrome-default.tar.gz<br \/>\necho $NOW<br \/>\ncd ~\/.config<br \/>\necho &#8220;Looking for $FILENAME&#8221;<br \/>\nif [ -f $FILENAME ];<br \/>\nthen<br \/>\necho &#8220;$FILENAME allready exist, renaming file to $FILENAME.$NOW&#8221; &amp;&amp; mv $FILENAME $FILENAME.$NOW<br \/>\nfi<br \/>\necho &#8220;Writting new backup file $FILENAME&#8221;<br \/>\ntar cf $FILENAME google-chrome\/<br \/>\necho &#8220;script done\/&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I wrote small this script, we needed it for our laptops at work, they have a single user account for simplicity. When our students sign in to google.com, their username is keept, which makes it problematic for user other students to sign in if not cleaned from Chrome. This script restores chrome to default &#8230;<\/p>\n<p><a href=\"https:\/\/blog.itso.dk\/?p=256\" class=\"more-link\">Continue reading &lsquo;Make a script for cleaning Google chrome, and set back to a predefined setup&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":262,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[34,35,5],"class_list":["post-256","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-tip","tag-chrome","tag-reset","tag-script"],"_links":{"self":[{"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/posts\/256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256"}],"version-history":[{"count":3,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions"}],"predecessor-version":[{"id":259,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions\/259"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=\/wp\/v2\/media\/262"}],"wp:attachment":[{"href":"https:\/\/blog.itso.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.itso.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}