Skip to content

Instantly share code, notes, and snippets.

@bryant1410
Created May 8, 2023 17:47
Show Gist options
  • Save bryant1410/f00b057f4948ba0d3d42a86b1cf38644 to your computer and use it in GitHub Desktop.
Save bryant1410/f00b057f4948ba0d3d42a86b1cf38644 to your computer and use it in GitHub Desktop.
System V init script for an EternalTerminal server (place under `/etc/init.d`)
#!/usr/bin/env bash
#
# chkconfig: 35 90 12
# description: EternalTerminal server
#
# Get function from functions library
. /etc/init.d/functions
start() {
/usr/bin/etserver &
### Create the lock file ###
touch /var/lock/subsys/etserver
success $"EternalTerminal server startup"
echo
}
stop() {
killall etserver
### Now, delete the lock file ###
rm -f /var/lock/subsys/etserver
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status etserver
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment