Skip to content

Execute file in computer startup

Good Night,

This is a simple tip, how to execute some file in computer startup. (I used this tip to enable the port forward on startup)

Copy your file to /etc/init.d/ using "cp file /etc/init.d/file"

Edit /etc/rc.local (as root) and add the file that you want to execute. You must use the full path like /etc/init.d/file.sh for example.

The file must have execution permissions, do this using "chmod +x /etc/init.d/file.sh"

Matheus

PS: You must add the line before "exit 0" in rc.local

Published inLinux

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.