summaryrefslogtreecommitdiff
path: root/homepanel.openrc
blob: 72a34a6f183fc3cc53c281cbd970ec94ff43be19 (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
31
32
33
34
#!/sbin/openrc-run
 
thisdir="$(dirname "$(readlink -f "$1")")"
homepanel_config_file="${thisdir}/homepanel.conf"
 
description="Home info panel"
directory="$thisdir"
command="/usr/bin/env PERL5LIB='${thisdir}/local/lib/perl5' PATH='/home/dakkar/perl5/perlbrew/perls/perl-5.36.0/bin:/bin:/usr/bin' ./driver-async.pl"
command_args="$homepanel_config_file"
pidfile="${thisdir}/homepanel.pid"
command_background=true
command_user=dakkar
output_log="${thisdir}/homepanel.out"
error_log="${thisdir}/homepanel.err"
directory="$thisdir"
name="HomePanel"
procname="perl"
 
depend() {
    need localmount net
    after bootmisc
}
 
start_pre() {
    local forecast_key output_file
    . $homepanel_config_file
    local dest_dir="$(dirname "$output_file")"
    local fstype="$(stat -f -c %T "$dest_dir")"
    if [[ "$fstype" != tmpfs ]]; then
        mkdir -p "$dest_dir"
        mount -t tmpfs none "$dest_dir"
        cp -a "$thisdir/icons" "$dest_dir/"
    fi
}