Created
January 17, 2020 05:24
-
-
Save sshilko/deeae71fce766d4fe7c81f15344008ae to your computer and use it in GitHub Desktop.
init-v cloudflared for xbian or other distros
This file contains hidden or 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
#!/bin/sh | |
nohup /usr/local/bin/cloudflared proxy-dns --port 5053 --upstream https://doh.cleanbrowsing.org/doh/family-filter/ > /dev/null 2>&1 & echo $! > /var/run/cloudflared.pid |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# /etc/init.d/cloudflared | |
# Provides: cloudflared | |
### END INIT INFO | |
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/ | |
DAEMON=/usr/local/bin/cloudflared-daemon.sh | |
PIDFILE=/var/run/cloudflared.pid | |
test -x $DAEMON || exit 0 | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_daemon_msg "Starting cloudflared" "cloudflared" | |
start_daemon -p $PIDFILE $DAEMON | |
log_end_msg $? | |
;; | |
stop) | |
log_daemon_msg "Stopping cloudflared" "cloudflared" | |
killproc -p $PIDFILE $DAEMON | |
log_end_msg $? | |
;; | |
force-reload|restart) | |
$0 stop | |
$0 start | |
;; | |
status) | |
status_of_proc -p $PIDFILE $DAEMON cloudflared && exit 0 || exit $? | |
;; | |
*) | |
echo "Usage: /etc/init.d/cloudflared {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment