wok annotate smartmontools/stuff/etc/init.d/smartd @ rev 22765
updated fltk packages (1.3.4.2 -> 1.3.5)
author | Hans-G?nter Theisgen |
---|---|
date | Sat Jan 25 13:47:19 2020 +0100 (2020-01-25) |
parents | 1b6281d68d9f |
children |
rev | line source |
---|---|
erjo@621 | 1 #!/bin/sh |
al@19159 | 2 # /etc/init.d/smartd : Start, stop and restart Smartmontools (SMART) daemon on SliTaz, at |
erjo@621 | 3 # boot time or with the command line. |
erjo@621 | 4 # |
erjo@621 | 5 # To start SMART monitoring at boot time, just put smartd in the $RUN_DAEMONS |
erjo@621 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf |
erjo@621 | 7 # |
erjo@621 | 8 . /etc/init.d/rc.functions |
erjo@621 | 9 . /etc/daemons.conf |
erjo@621 | 10 |
erjo@621 | 11 NAME=smartd |
al@19159 | 12 DESC="$(_ 'Smartmontools (SMART) Daemon')" |
erjo@621 | 13 DAEMON=/usr/sbin/smartd |
erjo@621 | 14 |
erjo@621 | 15 PIDFILE=/var/run/smartd.pid |
erjo@621 | 16 OPTIONS="-p $PIDFILE" |
erjo@621 | 17 |
erjo@621 | 18 case "$1" in |
erjo@621 | 19 start) |
pascal@6170 | 20 if active_pidfile $PIDFILE smartd ; then |
al@19159 | 21 _ '%s is already running.' $NAME |
erjo@621 | 22 exit 1 |
erjo@621 | 23 fi |
al@19159 | 24 action 'Starting %s: %s...' "$DESC" $NAME |
erjo@621 | 25 $DAEMON $OPTIONS |
erjo@621 | 26 status |
erjo@621 | 27 ;; |
erjo@621 | 28 stop) |
pascal@6170 | 29 if ! active_pidfile $PIDFILE smartd ; then |
al@19159 | 30 _ '%s is not running.' $NAME |
erjo@621 | 31 exit 1 |
erjo@621 | 32 fi |
al@19159 | 33 action 'Stopping %s: %s...' "$DESC" $NAME |
al@19159 | 34 kill $(cat $PIDFILE) |
erjo@621 | 35 status |
erjo@621 | 36 ;; |
erjo@621 | 37 restart) |
pascal@6170 | 38 if ! active_pidfile $PIDFILE smartd ; then |
al@19159 | 39 _ '%s is not running.' $NAME |
erjo@621 | 40 exit 1 |
erjo@621 | 41 fi |
al@19159 | 42 action 'Restarting %s: %s...' "$DESC" $NAME |
al@19159 | 43 kill $(cat $PIDFILE) |
erjo@621 | 44 sleep 2 |
erjo@621 | 45 $DAEMON $OPTIONS |
erjo@621 | 46 status |
erjo@621 | 47 ;; |
erjo@621 | 48 *) |
al@19159 | 49 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" |
al@19159 | 50 newline |
erjo@621 | 51 exit 1 |
erjo@621 | 52 ;; |
erjo@621 | 53 esac |
erjo@621 | 54 |
erjo@621 | 55 exit 0 |