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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#!/bin/sh
#
# startlat.sh
#
# Starts/Stops latd process
#
# chkconfig: - 79 79
# description: latd
# processname: latd
# config: /etc/latd.conf
#
# This script should go in /etc/rc.d/init.d/lat
#
# You can install it on a Red Hat system with:
#
# chkconfig --level 345 lat on
# -----------------------------------------------------------------------------
#
#
# See which distribution we are using and customise the start/stop
# commands and the console display.
#
if [ -d /var/lib/YaST ]
then
# SuSE
startendecho=""
stopendecho="done."
else
# Assume RedHat
startendecho=""
stopendecho="done."
fi
#
# Look for latcp
#
LATCP=""
[ -x /usr/sbin/latcp ] && LATCP="/usr/sbin/latcp"
[ -x /usr/local/sbin/latcp ] && LATCP="/usr/local/sbin/latcp"
if [ -z "$LATCP" ]
then
echo "Cannot find latcp."
exit 1
fi
case $1 in
start)
echo -n "Starting LAT: "
$LATCP -s
STATUS=$?
echo "$startendecho"
;;
stop)
echo -n "Stopping LAT... "
$LATCP -h
STATUS=$?
echo "$stopendecho"
;;
restart|reload)
echo -n "Restarting LAT: "
$LATCP -h
$LATCP -s
STATUS=$?
echo -n "$startecho"
echo "$stopendecho"
;;
*)
echo "Usage $0 {start|stop|restart}"
STATUS=0;
;;
esac
exit $STATUS
|