Re: help adding start and shutdown script
- From: Jan Gerrit Kootstra <jan.gerrit@xxxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 11:43:09 +0200
Matthäus Banach wrote:
Hi James,Hi James and Matthäus,
If you're using Gnome, you can start gnome-control-center and configure Gnome to start your ./start_net script at every logon. (As I use a localized version, I don't know what the icon inside the gnome-control-center is called, but it has to be something like "Sessions").
If you want Linux to look into the current directory for executables, just set the PATH variable. In bash you have to edit ~/.bash_profile.
If you add
PATH=$PATH:. # sets the PATH variable to the value it had
# before PLUS ".", the current directory
export PATH # exports the variable
to the file, it will do the trick.
Greetings from Germany,
Matthäus Banach
James A schrieb:
I have a customized driver for my wireless card running on Fedora Core 2.
To activate the card I have cd to a script directory and type "./start_net"
and to shut it down I type "./stop_net". How do I make them work without
having to type "./" before the command? I want to create a symlink to
/etc/rc.d/rc5.d so the wireless card starts automatically on boot up.
Matthäus approach has one disadvantage: A start script will not read profiles.
I would make a script /etc/init.d/mywireless like this:
-----------------------------------
CUT begin of script
----------------------------------
# chkconfig: - 99 1
# description: start/stop my wireless card
#
fullpath=thepathtothescriptdirectory
start() {
$fullpath/start_net
RETVAL=$?
return $RETVAL
}
stop() {
$fullpath/stop_net
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL
---------------------------------------
CUT end of script
---------------------------------------
To make the mywiresless script work:
chmod 711 /etc/init.d/mywireless
chckonfig --add mywireless
chkconfig mywireless on
Good luck,
Jan Gerrit Kootstra
.
- Follow-Ups:
- Re: help adding start and shutdown script
- From: James A
- Re: help adding start and shutdown script
- References:
- help adding start and shutdown script
- From: James A
- Re: help adding start and shutdown script
- From: Matthäus Banach
- help adding start and shutdown script
- Prev by Date: Re: help adding start and shutdown script
- Next by Date: Re: FC4 Gnome Menu
- Previous by thread: Re: help adding start and shutdown script
- Next by thread: Re: help adding start and shutdown script
- Index(es):
Relevant Pages
|