{"id":453,"date":"2015-05-21T10:14:32","date_gmt":"2015-05-21T15:14:32","guid":{"rendered":"http:\/\/www.g31zone.com\/?p=453"},"modified":"2015-05-21T10:14:32","modified_gmt":"2015-05-21T15:14:32","slug":"ubuntu-executing-a-script-at-startup-and-shutdown","status":"publish","type":"post","link":"https:\/\/www.g31zone.com\/?p=453","title":{"rendered":"Ubuntu &#8211; Executing a script at startup and shutdown"},"content":{"rendered":"<h3>To execute a script at startup of Ubuntu<\/h3>\n<ul>\n<li>Edit \/etc\/rc.local and add your commands<\/li>\n<li>The script must always end with exit 0<\/li>\n<\/ul>\n<h3>To execute a script upon rebooting Ubuntu:<\/h3>\n<ul>\n<li>Put your script in \/etc\/rc0.d<\/li>\n<li>Make it executable (sudo chmod +x myscript)<\/li>\n<li>Note: The scripts in this directory are executed in alphabetical order <\/li>\n<\/ul>\n<p>The name of your script must begin with K99 to run at the right time.<\/p>\n<h3>To execute a script at shutdown:<\/h3>\n<ul>\n<li>Put your script in \/etc\/rc6.d<\/li>\n<li>Make it executable (sudo chmod +x myscript)<\/li>\n<li>Note: The scripts in this directory are executed in alphabetical order <\/li>\n<\/ul>\n<p>The name of your script must begin with K99 to run at the right time.<\/p>\n<p>Watch the entire article <a href=\"http:\/\/en.kioskea.net\/faq\/3348-ubuntu-executing-a-script-at-startup-and-shutdown\" target=\"_blank\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To execute a script at startup of Ubuntu Edit \/etc\/rc.local and add your commands The script must always end with exit 0 To execute a script upon rebooting Ubuntu: Put your script in \/etc\/rc0.d Make it executable (sudo chmod +x myscript) Note: The scripts in this directory are executed in alphabetical order The name of<\/p>\n<p><a class=\"button\" href=\"https:\/\/www.g31zone.com\/?p=453\" title=\"More\">  Read More \u2192<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[156],"tags":[158,157,159],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-ubuntu","tag-execute-a-script-at-shutdown","tag-execute-a-script-at-startup-of-ubuntu","tag-execute-a-script-upon-rebooting-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/453"}],"collection":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=453"}],"version-history":[{"count":1,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":454,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions\/454"}],"wp:attachment":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}