1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#!/bin/sh
#
# Load unicon
#
# chkconfig: 234 95 05
# description: This package starts unicon.
# config: /usr/lib/unicon
# securlevel: 60
[ -f /usr/bin/unicon-start ] || exit 0
RETVAL=$?
UNICONPID=`pidof unicon`
case "$1" in
start)
if [ -f /var/lock/subsys/unicon ] && [ -n "$UNICONPID" ]; then
echo "Unicon has been already started!"
exit 2;
fi
echo "Starting unicon..."
/usr/bin/unicon-start
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/unicon
;;
stop)
if [ ! -f /var/lock/subsys/unicon ] && [ ! -n "$UNICONPID" ]; then
echo "Unicon has not been already started!"
exit 2;
fi
echo "Shuting down unicon... "
for i in `pidof unicon` ; do
if [ "$i" != "$$" ] ; then
kill $i ;
fi
done
lsmod | grep encode\- | while read a b ; do
rmmod $a ;
done
rmmod unikey
rm -f /var/lock/subsys/unicon
;;
restart|reload)
$0 stop
$0 start
exit 0
;;
status)
echo "unicon is runing with pid of $UNICONPID"
exit 0
;;
*)
echo "Usage: unicon {start|stop|restart|reload|status}"
exit 1
esac
exit $RETVAL
|