-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·47 lines (39 loc) · 1.12 KB
/
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
#!/bin/bash
checksudo=$(whoami)
if [ $checksudo != root ];then
echo "You need to run this install script as root or using sudo"
exit 0
fi
echo -e "Checking for aplay sound player...\n"
which aplay >/dev/null
exitcode=$?
if [ $exitcode = 1 ] ; then
echo -e "aplay not found, installing aplay...\n"
apt-get install alsa-utils
exitcode=$?
if [ $exitcode != 0 ] ;then
echo "Not able to install aplay. Exiting.."
exit 0
fi
elif [ $exitcode = 0 ]; then
echo -e "aplay found in $(which aplay)\n"
fi
echo -e "Copying sounds to /usr/share/sounds/fruitplayer...\n"
mkdir -p /usr/share/sounds/fruitplayer/
cp -rv sfx/* /usr/share/sounds/fruitplayer/
echo -e "\nCopying fruitplayer binary to /usr/bin/...\n"
cp -v fruitplayer /usr/bin/
echo -e "\nCreating systemd startup unit file...\n"
echo "[Unit]
Description=Fruitplayer
[Service]
Type=simple
ExecStart=/usr/bin/fruitplayer
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/fruitplayer.service
systemctl enable fruitplayer
echo -e "\nStarting fruitplayer...\n"
systemctl start fruitplayer &
echo -e "\nDone. You can now delete this directory\n"