Last active
August 29, 2015 14:12
-
-
Save siavashs/b7748b5ebf3b49288bf0 to your computer and use it in GitHub Desktop.
remote_syslog2 rc.d script for FreeBSD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# PROVIDE: remote_syslog | |
# | |
. /etc/rc.subr | |
name="remote_syslog" | |
rcvar="${name}_enable" | |
start_cmd="${name}_start" | |
stop_cmd="${name}_stop" | |
load_rc_config $name | |
remote_syslog_start() { | |
if [ ! -f /var/run/$name.pid ] | |
then | |
if checkyesno ${rcvar}; then | |
echo -n "Starting services: $name" | |
/usr/local/bin/remote_syslog --pid-file=/var/run/$name.pid | |
echo "." | |
fi | |
else | |
echo "It appears $name is already running. NOT starting!" | |
fi | |
} | |
remote_syslog_stop() { | |
if [ ! -f /var/run/$name.pid ] | |
then | |
echo "It appears $name is not running." | |
else | |
echo -n "Stopping services: $name" | |
kill `cat /var/run/$name.pid` | |
rm /var/run/$name.pid | |
echo "." | |
fi | |
} | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment