-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·51 lines (38 loc) · 1.11 KB
/
install.sh
File metadata and controls
executable file
·51 lines (38 loc) · 1.11 KB
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
48
49
50
#!/bin/bash
if [[ "$(id -u)" -eq "0" ]]; then
echo "Don't run as root"
return 1
fi
cd "$(dirname $0)"
APT_DEPS="python3-libusb1 python3-psutil"
for package in $APT_DEPS; do
dpkg -l "$package" > /dev/null
if [[ "$?" -eq "1" ]]; then
echo "Missing dependencies, installing"
sudo apt-get --assume-yes install $APT_DEPS
break
fi
done
SC="$HOME/steamcontroller"
echo "Checking for steamcontroller updates"
UPDATED=0
if [[ -d "$SC" ]]; then
pushd "$SC" > /dev/null
git pull
popd > /dev/null
else
git clone "https://github.com/ynsta/steamcontroller.git" "$SC"
fi
echo "Installing steamcontroller"
pushd "$SC" > /dev/null
sudo python3 setup.py install
popd > /dev/null
echo "Installing steamcontroller-watchdog service file"
SERVICEFILE="/lib/systemd/system/steamcontroller-watchdog.service"
sudo bash -c "sed 's,__INSTALLPATH__,$(pwd),' $(basename "$SERVICEFILE") > $SERVICEFILE"
echo "Reloading service files"
sudo systemctl daemon-reload
echo "Enabling steamcontroller-watchdog"
sudo systemctl enable steamcontroller-watchdog
echo "Starting steamcontroller-watchdog"
sudo systemctl start steamcontroller-watchdog