wok diff nagios-nrpe/stuff/nrpe @ rev 22158
updated xmlto (0.0.26 -> 0.0.28)
author | Hans-G?nter Theisgen |
---|---|
date | Thu Nov 07 10:41:56 2019 +0100 (2019-11-07) |
parents | 0d8a1a3edc72 |
children |
line diff
1.1 --- a/nagios-nrpe/stuff/nrpe Sun May 18 20:24:07 2014 +0000 1.2 +++ b/nagios-nrpe/stuff/nrpe Thu Nov 07 10:41:56 2019 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/nrpe : Start, stop and restart NRPE Server on SliTaz, at 1.6 +# /etc/init.d/nrpe : Start, stop and restart NRPE Server on SliTaz, at 1.7 # boot time or with the command line. 1.8 # 1.9 # To start SSH server at boot time, just put nagios in the $RUN_DAEMONS 1.10 @@ -9,50 +9,49 @@ 1.11 . /etc/daemons.conf 1.12 1.13 NAME=NRPE 1.14 -DESC="NRPE daemon" 1.15 +DESC="$(_ '%s daemon' NRPE)" 1.16 DAEMON=/usr/bin/nrpe 1.17 CONFIG_FILE="/etc/nagios/nrpe.cfg" 1.18 OPTIONS="-n -c $CONFIG_FILE -d" 1.19 PIDFILE=/var/run/nagios/nrpe.pid 1.20 1.21 if [ ! -d /var/run/nagios ]; then 1.22 - mkdir -p /var/run/nagios 1.23 - chown nagios.nagios /var/run/nagios 1.24 + mkdir -p /var/run/nagios 1.25 + chown nagios.nagios /var/run/nagios 1.26 fi 1.27 case "$1" in 1.28 start) 1.29 if active_pidfile $PIDFILE nrpe ; then 1.30 - echo "$NAME already running." 1.31 + _ '%s is already running.' $NAME 1.32 exit 1 1.33 fi 1.34 - echo -n "Starting $DESC: $NAME... " 1.35 - $DAEMON $OPTIONS 1.36 + action 'Starting %s: %s...' "$DESC" $NAME 1.37 + $DAEMON $OPTIONS 1.38 status 1.39 ;; 1.40 stop) 1.41 if ! active_pidfile $PIDFILE nrpe ; then 1.42 - echo "$NAME is not running." 1.43 + _ '%s is not running.' $NAME 1.44 exit 1 1.45 fi 1.46 - echo -n "Stopping $DESC: $NAME... " 1.47 - kill `cat $PIDFILE` 1.48 + action 'Stopping %s: %s...' "$DESC" $NAME 1.49 + kill $(cat $PIDFILE) 1.50 status 1.51 ;; 1.52 restart|reload) 1.53 if ! active_pidfile $PIDFILE nrpe ; then 1.54 - echo "$NAME is not running." 1.55 + _ '%s is not running.' $NAME 1.56 exit 1 1.57 fi 1.58 - echo -n "Restarting $DESC: $NAME... " 1.59 - kill `cat $PIDFILE` 1.60 + action 'Restarting %s: %s...' "$DESC" $NAME 1.61 + kill $(cat $PIDFILE) 1.62 sleep 2 1.63 $DAEMON $OPTIONS 1.64 status 1.65 ;; 1.66 *) 1.67 - echo "" 1.68 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]" 1.69 - echo "" 1.70 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart|reload]" 1.71 + newline 1.72 exit 1 1.73 ;; 1.74 esac