Skip to content

Instantly share code, notes, and snippets.

@RVIRUS0817

RVIRUS0817/vulsrepo

Last active Jan 12, 2018
Embed
What would you like to do?
/etc/init.d/
#!/bin/bash
#chkconfig: 2345 85 15
#descpriction: VulsRepo
#OS Amazon Linux/CentOS6
# source function library
. /etc/rc.d/init.d/functions
RETVAL=0
start() {
echo -n $"Starting VulsRepo: "
/usr/bin/nohup /home/vuls/vulsrepo/server/vulsrepo-server >/dev/null 2>&1 &
RETVAL=$?
if [ $RETVAL == 0 ]; then
success
else
failure
fi
echo
}
stop() {
echo -n $"Stopping VulsRepo: "
/usr/bin/pkill vulsrepo
RETVAL=$?
if [ $RETVAL == 0 ]; then
success
else
failure
fi
echo
}
status() {
if /usr/bin/pgrep vulsrepo > /dev/null
then
echo -n $"VulsRepo is running: "
else
echo -n $"VulsRepo is not running: "
fi
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
*)
echo -e $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment