diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-12-25 22:07:01 +0100 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-12-25 22:07:01 +0100 |
commit | 09f27804ee013b2816330bc567cc0f60c6b43e0d (patch) | |
tree | 682dc68db3aeeabca8795925a8e44669b4e9f3ae /apks/reddit-importer/reddit-importer.initd | |
parent | bbfc9e2f8f3dfd7ec856ea28ec08d71484482e5f (diff) | |
download | apkbuilds-09f27804ee013b2816330bc567cc0f60c6b43e0d.tar.gz apkbuilds-09f27804ee013b2816330bc567cc0f60c6b43e0d.tar.bz2 apkbuilds-09f27804ee013b2816330bc567cc0f60c6b43e0d.zip |
feat: Add reddit-importer
Diffstat (limited to 'apks/reddit-importer/reddit-importer.initd')
-rw-r--r-- | apks/reddit-importer/reddit-importer.initd | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/apks/reddit-importer/reddit-importer.initd b/apks/reddit-importer/reddit-importer.initd new file mode 100644 index 0000000..7298269 --- /dev/null +++ b/apks/reddit-importer/reddit-importer.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +supervisor="supervise-daemon" + +name="reddit-importer" +command="/usr/bin/reddit-importer" +command_args="-id ${client_id} + --secret ${client_secret} + -username ${reddit_username} + -password ${reddit_password} + " +command_background="yes" + +supervise_daemon_args="--user $cmd_user -d $tmp_dir" +pidfile="/run/$RC_SVCNAME.pid" +output_log="$logfile" +error_log="$logfile" + +start_pre() { + if [ "$logfile" ]; then + checkpath --file --mode 0640 --owner "cmd_user" "$logfile" || return 1 + fi + checkpath --directory --owner "$cmd_user" --mode 0775 "$tmp_dir" || return 1 +} + +depend() { + use net +} |