blob: 248eadbc67798ad7668353c653d63b40997a941a (
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
57
58
59
60
61
62
63
64
65
|
#Adapted from upsteam Debian install scripts
pre_install() {
NAME=fah-client
CLIENT_HOME=/var/lib/$NAME
# Create group if it does not exist
if ! getent group $NAME >/dev/null; then
groupadd --system $NAME || true
fi
# Create user if it does not exist
if ! getent passwd $NAME >/dev/null; then
useradd --system --gid $NAME --shell /usr/bin/nologin \
--home-dir $CLIENT_HOME --no-create-home \
--groups video $NAME || true
fi
}
post_install() {
NAME=fah-client
CLIENT_CONFIG=/etc/$NAME
CLIENT_LOGS=/var/log/$NAME
CLIENT_HOME=/var/lib/$NAME
#Set expected ownerships
chown $NAME:$NAME $CLIENT_CONFIG/
chown $NAME:$NAME $CLIENT_CONFIG/config.xml
chown $NAME:$NAME $CLIENT_LOGS/
chown $NAME:$NAME $CLIENT_LOGS/log.txt
chown $NAME:$NAME $CLIENT_HOME/
echo
echo "The Folding@home client is now installed"
echo
echo "File locations:"
echo
echo " Logs: /var/log/$NAME"
echo " Data: /var/lib/$NAME"
echo " Config: $CLIENT_CONFIG"
echo
echo "Service commands:"
echo
echo " systemctl status $NAME"
echo " systemctl enable $NAME"
echo " systemctl start $NAME"
echo " systemctl stop $NAME"
echo " systemctl restart $NAME"
echo
echo "Access the web interface by going to"
echo " https://v8-4.foldingathome.org/"
echo
echo "If upgrading from v7 move /etc/fahclient/config.xml to $CLIENT_CONFIG to retain settings"
echo
}
pre_remove() {
NAME=fah-client
systemctl stop $NAME
}
post_remove() {
NAME=fah-client
userdel $NAME
}
|