-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·54 lines (39 loc) · 939 Bytes
/
install.sh
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
#!/bin/sh
. ./etc/unit.default
export PATH=$UNITDIR/sbin:$PATH
if [ ! -x "$UNITDIR/sbin/unitd" ]; then
echo "Unit is not installed at $UNITDIR"
exit 1
fi
if ! mkdir -p /etc/default; then
echo "failed to create /etc/default"
exit 1
fi
if ! cp etc/unit.default /etc/default/unit; then
echo "failed to copy unit defaults"
exit 1
fi
if ! cp systemd/unit.service /etc/systemd/system/unit.service; then
echo "failed to copy unit.service to /etc/systemd/system"
exit 1
fi
chmod 664 /etc/systemd/system/unit.service
if ! systemctl enable unit.service; then
echo "failed to enable systemd service"
exit 1
fi
systemctl daemon-reload
if ! mkdir -p /var/www; then
echo "failed to create /var/www"
exit 1
fi
if ! cp -r www/* /var/www; then
echo "failed to copy www files"
exit 1
fi
if ! chown -R nobody:nogroup /var/www; then
echo "failed to change user and group of /var/www"
exit 1
fi
echo "services installed"
exit 0