#!/bin/sh ### BEGIN INIT INFO # Provides: aerofsts-cli # Required-Start: $remote_fs # Required-Stop: # Default-Start: S # Default-Stop: # Short-Description: AerofsTeamServer # Description: Aero FS Team Server ### END INIT INFO . /lib/lsb/init-functions [ -f /etc/default/rcS ] && . /etc/default/rcS PATH=/bin:/usr/bin:/sbin:/usr/sbin PROGRAM=/usr/bin/aerofsts-cli test -x $PROGRAM || exit 0 case "$1" in start) log_begin_msg "Starting aerofsts-cli" su aerofs -c "/usr/bin/aerofsts-cli 1> /dev/null 2> /dev/null &" log_end_msg 0 ;; stop) kill $(ps f -u aerofs | grep "/usr/bin/aerofsts-cli" | grep -Po "^\s?\d+") 1> /dev/null 2> /dev/null kill $(ps f -u aerofs | grep "aerofsts-bin/aerofsd" | grep -Po "^\s?\d+") 1> /dev/null 2> /dev/null kill $(ps f -u aerofs | grep "aerofsts-bin/aerofs.jar" | grep -Po "^\s?\d+") 1> /dev/null 2> /dev/null ;; force-reload|restart) $0 stop $0 start ;; status) exit 0 ;; *) log_success_msg "Usage: /etc/init.d/aerofs {start|stop|restart|force-reload|status}" exit 1 esac exit 0