Created
December 16, 2017 08:54
-
-
Save WordlessEcho/2e73c03e0999906b5442b7d8bea078fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks for https://github.com/fatedier/frp/issues/145#issuecomment-256967035 | |
# Change for origin: user nobody, save frp at /usr/bin/frp/ (same of https://aur.archlinux.org/packages/frp/) | |
#!/bin/sh | |
NAME=frps | |
DAEMON=/usr/bin/frp/$NAME | |
CONFIG=/etc/frp/$NAME.ini | |
[ -x "$DAEMON" ] || exit 0 | |
case "$1" in | |
start) | |
echo "Starting $NAME..." | |
start-stop-daemon --start --chuid nobody --exec $DAEMON --quiet --oknodo --background -- -c $CONFIG || return 2 | |
;; | |
stop) | |
echo "Stopping $NAME..." | |
start-stop-daemon --stop --exec $DAEMON --quiet --oknodo --retry=TERM/30/KILL/5 || return 2 | |
;; | |
restart) | |
$0 stop && sleep 2 && $0 start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment