Skip to content

Commit

Permalink
Create cloudflared-for-alpinelinux
Browse files Browse the repository at this point in the history
  • Loading branch information
notsudoers authored Jan 11, 2025
1 parent f90fa22 commit ee90790
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions etc/init.d/cloudflared-for-alpinelinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/sbin/openrc-run

#token=
name=${RC_SVCNAME}
command="/usr/bin/cloudflared"
pidfile=/run/${RC_SVCNAME}.pid
command_args="--protocol auto --pidfile $pidfile --autoupdate-freq 24h0m0s tunnel run --token $token"
command_user=root
output_log="/var/log/${RC_SVCNAME}.log"
error_log="/var/log/${RC_SVCNAME}.err"

depend() {
after networking
}

start() {
ebegin "Starting $name"
start-stop-daemon --start \
--quiet \
--background \
--user ${command_user} \
--stdout ${output_log} \
--stderr ${error_log} \
--make-pidfile \
--pidfile ${pidfile} \
--exec ${command} \
-- ${command_args}
eend $?
}

0 comments on commit ee90790

Please sign in to comment.