webmin/webmin-init

88 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

2007-04-12 20:24:50 +00:00
#!/bin/sh
# chkconfig: 235 99 10
2017-10-20 16:55:05 +08:00
# description: web-based administration interface for Unix systems
2007-04-12 20:24:50 +00:00
#
### BEGIN INIT INFO
2017-10-20 16:55:05 +08:00
# Provides: webmin
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
2023-10-11 18:51:22 +03:00
# Short-Description: Web-based administration interface for Unix systems
2017-10-20 16:55:05 +08:00
# Description: Webmin is a web-based interface for system administration
# for Unix. Using Webmin you can configure DNS, Samba, NFS,
# local/remote filesystems and more using your web browser.
2007-04-12 20:24:50 +00:00
### END INIT INFO
2017-10-20 16:55:05 +08:00
PATH=/sbin:/usr/sbin:/bin:/usr/bin
2023-10-11 18:51:22 +03:00
DESC="Web-based administration interface for Unix systems"
2017-10-20 16:55:05 +08:00
NAME=Webmin
PIDFILE=/var/webmin/miniserv.pid
SCRIPTNAME=/etc/init.d/webmin
START=/etc/webmin/.start-init
STOP=/etc/webmin/.stop-init
FORCERESTART=/etc/webmin/.restart-by-force-kill-init
RELOAD=/etc/webmin/.reload-init
2017-10-20 16:55:05 +08:00
LOCKFILE=/var/lock/subsys/webmin
CONFFILE=/etc/webmin/miniserv.conf
2007-04-12 20:24:50 +00:00
case "$1" in
2017-10-20 16:55:05 +08:00
start)
$START
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
touch $LOCKFILE >/dev/null 2>&1
2007-04-12 20:24:50 +00:00
fi
;;
2017-10-20 16:55:05 +08:00
stop)
$STOP
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
rm -f $LOCKFILE
pidfile=`grep "^pidfile=" $CONFFILE | sed -e 's/pidfile=//g'`
if [ "$pidfile" = "" ]; then
pidfile=$PIDFILE
fi
rm -f $pidfile
fi
;;
status)
pidfile=`grep "^pidfile=" $CONFFILE | sed -e 's/pidfile=//g'`
if [ "$pidfile" = "" ]; then
pidfile=$PIDFILE
fi
if [ -s $pidfile ]; then
pid=`cat $pidfile`
kill -0 $pid >/dev/null 2>&1
if [ "$?" = "0" ]; then
echo "$NAME (pid $pid) is running"
RETVAL=0
2007-04-12 20:24:50 +00:00
else
2017-10-20 16:55:05 +08:00
echo "$NAME is stopped"
2007-04-12 20:24:50 +00:00
RETVAL=1
fi
else
echo "$NAME is stopped"
RETVAL=1
2007-04-12 20:24:50 +00:00
fi
;;
2017-10-20 16:55:05 +08:00
restart)
$STOP ; $START
2017-10-20 16:55:05 +08:00
RETVAL=$?
;;
restart-by-force-kill)
$FORCERESTART
2022-04-19 20:20:09 +03:00
RETVAL=$?
;;
reload|force-reload)
$RELOAD
2007-04-12 20:24:50 +00:00
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|restart-by-force-kill|reload|force-reload|status}" >&2
2007-04-12 20:24:50 +00:00
RETVAL=1
;;
esac
exit $RETVAL