Skip to content

Commit 2c48c6e

Browse files
author
Jeff Fredrickson
committed
installer can now enable/start service automatically
1 parent f029aea commit 2c48c6e

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ This simply installs `zenstates.py` from [ZenStates-Linux](https://github.com/r4
1010
git clone https://github.com/jfredrickson/disable-c6.git
1111
cd disable-c6
1212
sudo ./install.sh
13-
systemctl enable disable-c6.service
14-
systemctl start disable-c6.service
1513
```
1614

1715
This will install a systemd unit called `disable-c6` to the default location, `/opt/disable-c6`, and create a symlink in `/etc/systemd/system`.

install.sh

+19-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ mkdir -p $SYSTEMD_UNIT_DIR
3535
sed "s@{{PREFIX}}@$PREFIX@" disable-c6.service.template > $SYSTEMD_UNIT_DIR/disable-c6.service
3636
install lib/ZenStates-Linux/zenstates.py $PREFIX/bin/zenstates.py
3737

38-
echo "Installed disable-c6 service. You may want to:"
39-
echo " systemctl enable disable-c6.service"
40-
echo " systemctl start disable-c6.service"
38+
echo "Installed disable-c6 service."
39+
40+
while true ; do
41+
read -p "Would you like to enable and start the service now [y/n]? " YN
42+
case $YN in
43+
[Yy]*)
44+
systemctl enable disable-c6.service
45+
systemctl start disable-c6.service
46+
echo "Enabled disable-c6 service."
47+
exit 0
48+
;;
49+
[Nn]*)
50+
echo "To enable and start the service:"
51+
echo " systemctl enable disable-c6.service"
52+
echo " systemctl start disable-c6.service"
53+
exit 0
54+
;;
55+
esac
56+
done

0 commit comments

Comments
 (0)