forked from MiczFlor/RPi-Jukebox-RFID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_installation.sh
executable file
·39 lines (33 loc) · 1.15 KB
/
check_installation.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
#!/usr/bin/env bash
FRED="\033[31m"
FBOLD='\033[1;31m'
RS="\033[0m"
ERROR=false
for SERVICE_NAME in "phoniebox-gpio-buttons.service" "phoniebox-rotary-encoder.service"
do
echo "checking ${SERVICE_NAME}"
if [ "$(systemctl is-active ${SERVICE_NAME})" = "active" ]; then
echo -e "$FRED"$FBOLD" ${SERVICE_NAME} is still active $RS"
ERROR=true
fi
done
SERVICE_STATUS="$(systemctl is-active phoniebox-gpio-control.service)"
if [ "${SERVICE_STATUS}" = "active" ]; then
echo "Phoniebox GPIO Service started correctly ....."
else
ERROR=true
echo ""
echo -e "$FRED"$FBOLD"Problem during installation occured $RS"
echo " Service not running, please check functionallity by running gpio_control.py "
echo " in the directory ~/RPi-Jukebox-RFID/components/gpio_control: "
echo " $ cd ~/RPi-Jukebox-RFID/components/gpio_control"
echo " $ python gpio_control.py"
echo " or check output of journaclctl by:"
echo " $ journalctl -u phoniebox-gpio-control.service -f"
fi
echo
if $ERROR ; then
echo -e "$FRED"$FBOLD"PROBLEM IN INSTALLATION $RS"
else
echo 'Installation seems to be fine'
fi