- Code: Select all
#!/bin/sh
#
# pants Make sure we're wearing pants. Should always be used in
# multiuser mode.
#
# Source : http://www.vergenet.net/~conrad/scripts/pants.html
# description: Puts on or takes off pants.
. /etc/live.cfg
# See how we were called.
case "$1" in
boot)
echo -n "Patching pants... ";=
;;
start)
echo -n "Putting on my pants."
# For SMP systems, only.
# NUMPROC=`grep -c "^cpu[0-9]" /proc/stat`
# if [ "$NUMPROC" -gt "1" ]; then
# echo -n ", one leg at a time"
# fi
# First check to see if we're still wearing an old pair
if [ -f /var/pants.pid ]; then
echo "."
echo "Looks like I've still got some old pants on. They'll do."
else
# You'd better start wearing pants now.
cat /dev/null > /var/pants.pid
echo -n " ";=
fi
;;
stop)
# Hooray!
echo -n "Taking off my pants "
rm -f /var/pants.pid
=
;;
reload|restart)
echo "Time for a change of my pants."
$0 stop
$0 start
;;
status)
if [ -f /var/pants.pid ]; then
echo "My pants are ON ..."
else
echo "I'm not wearing any pants ..."
fi
;;
*) echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
No attachments here, sorry.
TalkingToes
Seattle, WA