forked from craftbeerpi/craftbeerpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
29 lines (24 loc) · 810 Bytes
/
config.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
#!/bin/bash
clear;
cat << "EOF"
The installation must be set to auto start for using this tool!!
1 = start CraftBeerPi
2 = stop CraftBeerPi
3 = status of CraftBeerPi
4 = Add this installation to auto start
5 = Remove this CraftBeerPi installation from auto start
EOF
while true; do
read -p "Please select a number: " yn
case $yn in
[1]* ) sudo /etc/init.d/craftbeerpiboot start break;;
[2]* ) sudo /etc/init.d/craftbeerpiboot stop break;;
[3]* ) sudo /etc/init.d/craftbeerpiboot status break;;
[4]* ) sed "s@#DIR#@${PWD}@g" config/craftbeerpiboot > /etc/init.d/craftbeerpiboot
chmod 755 /etc/init.d/craftbeerpiboot
update-rc.d craftbeerpiboot defaults
break;;
[5]* ) update-rc.d craftbeerpiboot remove; break;;
* ) break;;
esac
done