Results 1 to 4 of 4
Im using my Linux server as a router(debian)
But every time i restart it i have to type 2 commands to start the routing! but i want it to autoexec ...
- 01-26-2007 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 42
Auto exec file?
Im using my Linux server as a router(debian)
But every time i restart it i have to type 2 commands to start the routing! but i want it to autoexec on startup, if thats extreamly hard i want it to exec on login
- 01-26-2007 #2Linux User
- Join Date
- Feb 2006
- Posts
- 484
write the command to a script
give the run permission to the script and copy it to the /etc/init.d directory
make a symlink from /etc/rcX.d to the script in the init directory
X means the runlevel
each symlinks have this format "S"or"K""ordinal number""name"
for example:
the script
save it as routingCode:#!/bin/sh routing command 1 routing command 2 exit 0
chmod 744 routing
cp routing /etc/init.d
the default runlevel is 2
ln -s /etc/init.d/routin /etc/rc2.d/S90routing
and its done
- 01-28-2007 #3Just Joined!
- Join Date
- Jan 2007
- Posts
- 42
Im such a newbie...... i didnt understand that
if i want the command "# echo 1 > /proc/sys/net/ipv4/ip_forward" to run every time user "myuser" log in...
whats the script then?
- 01-28-2007 #4Linux User
- Join Date
- Feb 2006
- Posts
- 484
put that line to the .bashrc file in "myuser"s home and it will run run evry time when you log in


Reply With Quote
