mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-21 10:15:12 +03:00
26 lines
641 B
Text
26 lines
641 B
Text
#!/sbin/openrc-run
|
|
|
|
name="$SVCNAME"
|
|
command="/usr/bin/noprs"
|
|
command_user="$SVCNAME"
|
|
command_args="$NOPRS_OPTS '$COMMENT_FILE'"
|
|
command_background="yes"
|
|
pidfile="/var/run/$SVCNAME.pid"
|
|
error_log="/var/log/noprs.log"
|
|
|
|
depend() {
|
|
use net
|
|
}
|
|
|
|
start_pre() {
|
|
[ -e "$COMMENT_FILE" ] || \
|
|
eerror "File '$COMMENT_FILE' does not exist"
|
|
|
|
export GITHUB_ACCESS_TOKEN GITHUB_WEBHOOK_SECRET
|
|
[ -z "$GITHUB_ACCESS_TOKEN" -o -z "$GITHUB_WEBHOOK_SECRET" ] && \
|
|
eerror "Access token and/or webhook secret not configured."
|
|
|
|
# Create log file for unprivileged user
|
|
checkpath --owner "${command_user}:${command_user}" \
|
|
-f --mode 0644 "${error_log}"
|
|
}
|