summaryrefslogtreecommitdiffstats
path: root/abs/extra/community/squeezeboxserver/squeezeboxserver.install
blob: 058de025bf5bf144326c3ce8b3b17b71af26d796 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
post_install() {
echo -n "adding squeezeboxserver user... "
useradd -c "SqueezeBoxServer" -g users -s /bin/false squeezeboxserver && echo "done."
passwd -l squeezeboxserver &>/dev/null

chown -R squeezeboxserver:users /home/squeezeboxserver

install -o squeezeboxserver -d /var/cache/squeezeboxserver
touch /var/log/squeezeboxserver.log
chown squeezeboxserver:users /var/log/squeezeboxserver.log

cat << 'EOM'

==> SqueezeBoxServer uses MySQL instead of sqlite. If you have MySQL up and running
==> you can configure SqueezeBoxServer to use that server as described here:
==> http://wiki.slimdevices.com/index.php/ExistingMySQLInstance 

==> PLEASE NOTE: SqueezeBoxServer should always be run as the user 'squeezeboxserver'.
==> This is easily done by adding squeezeboxserver to the DAEMONS array in rc.conf,
==> after network and mysql.

==> Additional run-time options can be added to /etc/conf.d/squeezeboxserver.
==> Please refer to "/home/squeezeboxserver/slimserver.pl --help" for full details.

EOM
}

post_upgrade() {
chown -R squeezeboxserver:users /home/squeezeboxserver

cat << 'EOM'

==> SqueezeBoxServer uses MySQL instead of sqlite. If you have MySQL up and running
==> you can configure SqueezeBoxServer to use that server as described here:
==> http://wiki.slimdevices.com/index.php/ExistingMySQLInstance 

EOM
}

pre_remove() {
# pre_remove gets called whenever post_remove is defined.
true
}

post_remove() {
# post_remove doesn't start at a newline like the other post_* functions,
# so we'll have to make one for ourselves.
echo -n -e "\nremoving squeezeboxserver user... "
userdel squeezeboxserver && echo "done."

rm -r /var/cache/squeezeboxserver /var/log/squeezeboxserver.log
}

op=$1
shift
$op $*