aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/etc/rc.d/ttrssd.ttrss_server
blob: d04fa3df2db72cc6f602d74cfac057bdd741becd (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

# PROVIDE: ttrssd
# REQUIRE: NETWORKING kstart
# KEYWORD: shutdown

. /etc/rc.subr

name='ttrssd'
rcvar='ttrssd_enable'

load_rc_config "$name"
: ${ttrssd_enable='NO'}
: ${ttrssd_webroot='/usr/local/www/tt-rss'}
: ${ttrssd_user='www'}
: ${ttrssd_syslog_priority:='info'}
: ${ttrssd_syslog_facility:='daemon'}

ttrssd_syslog_tag=$name
ttrssd_chdir=$ttrssd_webroot

pidfile="/var/run/${name}/${name}.pid"
procname=/usr/local/bin/php

command=/usr/sbin/daemon
command_args="-f \
-s ${ttrssd_syslog_priority} \
-l ${ttrssd_syslog_facility} \
-T ${ttrssd_syslog_tag} \
-p ${pidfile} \
-t ${name} \
/usr/local/bin/php \
-d syslog.ident=${ttrssd_syslog_tag} \
-d syslog.facility=${ttrssd_syslog_facility} \
${ttrssd_webroot}/update_daemon2.php"

required_files="${ttrssd_webroot}/config.php"
start_precmd=ttrssd_prestart

ttrssd_prestart(){
  install -d -m 0755 -o ${ttrssd_user} "/var/run/${name}"
}

# ttrss needs git to show its version info.
PATH='/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'

run_rc_command "$1"