two questions about the following script i created
Code:
#!/bin/bash
test=$1
if [ "$test" = "start" ]
then
/usr/local/sbin/LCDd -d MtxOrb&
sleep 1
/usr/bin/mtxorb /dev/lcd
sleep 1
/usr/local/bin/lcdproc K -d
else
if [ "$test" = "stop" ]
then
killall lcdproc
killall LCDd
else
if [ "$test" = "restart" ]
then
killall lcdproc
sleep 1
killall LCDd
sleep 1
/usr/local/sbin/LCDd -d MtxOrb&
sleep 1
/usr/bin/mtxorb /dev/lcd
sleep 1
/usr/local/bin/lcdproc K -d
else
echo restart start or stop
fi
fi
fi
the purpose is to start and stop LCDd and a clock lcdproc client
first question, how could this perhaps be made more efficient
second of all, i put it in /etc/rc.d/init.d and linked it to the proper names in the /etc/rc.d/rcX.d directories, how do i get it to appear under "system services" within the "setup" program so it can start and stop on runlevel change?
opps, third, how do i get it to say
starting lcd [ OK ] or [ FAIL ]
and
stoping lcd [ OK ] or [ FAIL ]
when invoked?