Skip to content

Instantly share code, notes, and snippets.

@attomos
Created September 1, 2012 17:40
Show Gist options
  • Save attomos/3581313 to your computer and use it in GitHub Desktop.
Save attomos/3581313 to your computer and use it in GitHub Desktop.
Execute shell script or python script on startup (Ubuntu). Assume that you save dosomething.sh at ~/Desktop
#!/bin/bash
echo "Really do some thing"
chmod +x ~/Desktop/dosomething.sh
cd /etc/init.d
sudo ln -s ~/Desktop/dosomething.sh
sudo update-rc.d dosomething.sh defaults
# restart the operating system and check whether it's running or not
ps -ef | grep dosomething.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment