You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.0 KiB
61 lines
1.0 KiB
#!/bin/sh
|
|
# Start/stop g2_link
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: g2_link
|
|
# Required-Start: $remote_fs $network
|
|
# Required-Stop: $null
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: g2_link
|
|
# Description: g2_link
|
|
### END INIT INFO
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
G2_LINK_EXE=/usr/local/bin/g2_link
|
|
G2_LINK_CFG=/usr/local/etc/g2.cfg
|
|
G2_LINK_LOG=/var/log/g2_link.log
|
|
|
|
start() {
|
|
|
|
status_of_proc g2_link >/dev/null
|
|
RETVAL=$?
|
|
if [ "$RETVAL" = "0" ] ; then
|
|
echo "g2_link already running"
|
|
else
|
|
echo -n "Starting g2_link"
|
|
start-stop-daemon --exec $G2_LINK_EXE -S $G2_LINK_CFG > $G2_LINK_LOG 2>&1 &
|
|
log_end_msg $?
|
|
fi
|
|
|
|
}
|
|
|
|
stop() {
|
|
start-stop-daemon --exec $G2_LINK_EXE --retry 5 -K
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
stop
|
|
start
|
|
;;
|
|
|
|
status)
|
|
echo -n "g2_link "
|
|
status_of_proc g2_link
|
|
;;
|
|
|
|
*) log_action_msg "Usage: /etc/init.d/g2_link {start|stop|restart|status}"
|
|
exit 2
|
|
;;
|
|
esac
|
|
exit 0
|
|
|