Need to run a .sh as root on boot or login
You can try putting your file.sh in /etc/init.d/ and use update-rc.d
update-rc.d file.sh defaults
To get a file to execute at start up you essentially want to put the .desktop in
/etc/xdg/autostart/
Here is how to set up a .desktop for your file from the command line:
sudo mv file.sh /usr/bin
This moves the shell file path to /usr/bin
.
Then go to
/usr/share/applications
Nextyou want to create a .desktop file so you type
sudo -H gedit file.desktop &
The & means you can still use the terminal but leave the file open. Handy if you have a goldfish memory like I do.
In gedit write:
[Desktop Entry]
Name=myfileName
Exec=/usr/bin/file.sh
Type=Application
Terminal=false
You can close it now if you like. You can jazz it up with an icon by adding the line icon=path/to/icon
too if that takes your fancy.
Now to get this file to to run on start up you need to save a copy of it into
/etc/xdg/autostart/
That should work provided the script (myfile.sh) works already, that is.