aboutsummaryrefslogtreecommitdiff
path: root/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd
blob: 9303e1b11c7a2bb1e97e5227b176b9e0a25f3b47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/sbin/openrc-run
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_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
}