forked from benstobbs/GPIOShortcuts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·37 lines (31 loc) · 763 Bytes
/
install.sh
File metadata and controls
executable file
·37 lines (31 loc) · 763 Bytes
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
#!/bin/bash
if [[ "$EUID" = 0 ]]; then
echo "Already root"
else
sudo -k
if sudo true; then
echo "Successfully got root"
else
echo "Wrong password"
exit 1
fi
fi
sudo pip3 install pyautogui
sudo pip3 install pynput
ETC=/etc/GPIOShortcuts
SYSTEMD=/lib/systemd/system/
if [ ! -d $DIR ]; then
sudo mkdir $ETC
fi
sudo cp config.txt $ETC
sudo cp service.py $ETC
sudo cp GPIOShortcuts.service $SYSTEMD
sudo cp GPIOrestart.* $SYSTEMD
sudo chmod 644 $SYSTEMD/GPIOShortcuts.service
sudo chmod 644 $SYSTEMD/GPIOrestart.*
sudo chmod +x $ETC/service.py
sudo systemctl daemon-reload
sudo systemctl enable GPIOrestart.timer
sudo systemctl enable GPIOShortcuts.service
sudo systemctl restart GPIOShortcuts.service
echo "Done"