aboutsummaryrefslogtreecommitdiff
path: root/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd
diff options
context:
space:
mode:
Diffstat (limited to 'apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd')
-rw-r--r--apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd19
1 files changed, 16 insertions, 3 deletions
diff --git a/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd b/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd
index 7b48eeb..9beed1f 100644
--- a/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd
+++ b/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd
@@ -3,15 +3,28 @@ supervisor="supervise-daemon"
name="reddit-nextcloud-importer"
command="/usr/bin/reddit-nextcloud-importer"
-command_args=" -c ${client_id} -s ${client_secret} -u ${reddit_username} -p ${reddit_password} -P ${nextcloud_password} -U ${nextcloud_username} -o ${nextcloud_host}"
+command_args="-c ${client_id}
+ -s ${client_secret}
+ -u ${reddit_username}
+ -p ${reddit_password}
+ -P ${nextcloud_password}
+ -U ${nextcloud_username}
+ -o ${nextcloud_host}
+ "
command_background="yes"
-supervise_daemon_args="--user www-data:www-data"
+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
}
-