mirror of
				https://github.com/Wind4/vlmcsd.git
				synced 2025-11-04 16:22:16 +01:00 
			
		
		
		
	Remove binaries from gh-pages branch
This commit is contained in:
		
							
								
								
									
										81
									
								
								scripts/init.d/vlmcsd-rhel
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								scripts/init.d/vlmcsd-rhel
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,81 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# VLMCSD - this script starts and stops the KMS Server daemon
 | 
			
		||||
#
 | 
			
		||||
### BEGIN SERVICE INFO
 | 
			
		||||
# Run level information:
 | 
			
		||||
# chkconfig: 2345 99 99
 | 
			
		||||
# description: KMS Emulator in C
 | 
			
		||||
# processname: vlmcsd
 | 
			
		||||
### END SERVICE INFO
 | 
			
		||||
 | 
			
		||||
# Source function library
 | 
			
		||||
source /etc/init.d/functions
 | 
			
		||||
 | 
			
		||||
# Check that networking is up.
 | 
			
		||||
[ ${NETWORKING} ="yes" ] || exit 0
 | 
			
		||||
 | 
			
		||||
NAME=vlmcsd
 | 
			
		||||
SCRIPT=/usr/bin/vlmcsd
 | 
			
		||||
RUNAS=
 | 
			
		||||
 | 
			
		||||
PIDFILE=/var/run/$NAME.pid
 | 
			
		||||
LOGFILE=/var/log/$NAME.log
 | 
			
		||||
 | 
			
		||||
start() {
 | 
			
		||||
  if [ -f "$PIDFILE" ] && kill -0 $(cat "$PIDFILE"); then
 | 
			
		||||
    echo 'Service already running.'
 | 
			
		||||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
  echo 'Starting service...'
 | 
			
		||||
  local CMD="$SCRIPT -p $PIDFILE -l $LOGFILE"
 | 
			
		||||
  su -c "$CMD" $RUNAS
 | 
			
		||||
  echo 'Service started.'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop() {
 | 
			
		||||
  if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
 | 
			
		||||
    echo 'Service not running.'
 | 
			
		||||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
  echo 'Stopping service...'
 | 
			
		||||
  kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
 | 
			
		||||
  echo 'Service stopped.'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
status() {
 | 
			
		||||
  echo "Checking $NAME service..."
 | 
			
		||||
  if [ -f "$PIDFILE" ]; then
 | 
			
		||||
    local PID=$(cat "$PIDFILE")
 | 
			
		||||
    kill -0 $PID
 | 
			
		||||
    if [ $? -eq 0 ]; then
 | 
			
		||||
      echo "Running, the PID is $PID."
 | 
			
		||||
    else
 | 
			
		||||
      echo 'The process appears to be dead but pidfile still exists.'
 | 
			
		||||
    fi
 | 
			
		||||
  else
 | 
			
		||||
    echo 'Service not running.'
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
case "$1" in
 | 
			
		||||
  start)
 | 
			
		||||
    start
 | 
			
		||||
    ;;
 | 
			
		||||
  stop)
 | 
			
		||||
    stop
 | 
			
		||||
    ;;
 | 
			
		||||
  status)
 | 
			
		||||
    status
 | 
			
		||||
    ;;
 | 
			
		||||
  restart)
 | 
			
		||||
    stop
 | 
			
		||||
    start
 | 
			
		||||
    ;;
 | 
			
		||||
  *)
 | 
			
		||||
    echo "Usage: $0 {start|stop|status|restart}"
 | 
			
		||||
    exit 1
 | 
			
		||||
    ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
exit 0
 | 
			
		||||
		Reference in New Issue
	
	Block a user