LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Auto-Executing Shell Script on boot (https://www.linuxquestions.org/questions/linux-software-2/auto-executing-shell-script-on-boot-267470/)

benrose111488 12-17-2004 01:51 PM

Auto-Executing Shell Script on boot
 
Hey everyone.. I have a schell script written, which is right now /etc/profile.d/gateway.sh

The point of this script is to automatically execute all the commands needed to run Linux as a gateway for a WinXP machine.

The problem is that every time I open a terminal or log in anywhere it executes

Where can I put this file so that it'll be started ONLY on boot?

Thanks in advance.

saravkrish 12-17-2004 02:01 PM

In /etc/rc.local

~Sarav

benrose111488 12-17-2004 03:55 PM

As any name?

example:

/etc/rc.d/gateway.sh

Or should I just add the code to one of the existing files in that directory?

saravkrish 12-17-2004 05:06 PM

Quote:

Originally posted by benrose111488
As any name?

example:

/etc/rc.d/gateway.sh

Or should I just add the code to one of the existing files in that directory?

You didn't read my reply properly. I said /etc/rc.local not /etc/rc.d.

/etc/rc.local is a file. You should call your script from that file.

~Sarav

benrose111488 12-17-2004 07:55 PM

ahhhh I understand now

Thank you very much, it's working now :)

saravkrish 12-18-2004 12:52 AM

No problem. Enjoy.

~Sarav


All times are GMT -5. The time now is 10:47 AM.