Skip to content

Commit 58040e3

Browse files
committed
add reinstall and update
1 parent 3f0fa1a commit 58040e3

File tree

2 files changed

+44
-43
lines changed

2 files changed

+44
-43
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Press Ctrl-D to exit
5757
`reboot` reboot to activate the changes
5858
### Install
5959
Run these as a sudo user or root!
60+
If you want to reinstall or update piduck rerun the below script.
6061

6162
#### if you have curl
6263

install.sh

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,51 @@ then
1313
fi
1414
exit $?
1515
fi
16-
if [[ -d "/etc/piduck" ]]
16+
#if [[ -d "/etc/piduck" ]]
17+
#then
18+
# echo "Seems like piduck is already installed!"
19+
# exit 4
20+
#else
21+
if [[ "$(which git)" != "" ]]
1722
then
18-
echo "Seems like piduck is already installed!"
19-
exit 4
23+
echo "Using git!"
24+
git clone https://github.com/gitdev-bash/piduck.git /tmp/piduck
25+
elif [[ "$(which wget)" != "" && "$(which unzip)" != "" ]]
26+
then
27+
echo "Using wget and unzip"
28+
wget -q -O /tmp/piduck.zip https://github.com/gitdev-bash/piduck/zipball/master/
29+
unzip /tmp/piduck.zip
30+
rm /tmp/piduck.zip
31+
elif [[ "$(which curl)" != "" && "$(which unzip)" != "" ]]
32+
then
33+
echo "Using curl and unzip"
34+
curl -sSL -o /tmp/piduck.zip https://github.com/gitdev-bash/piduck/zipball/master/
35+
unzip /tmp/piduck.zip
36+
rm /tmp/piduck.zip
37+
elif [[ "$(which wget)" != "" && "$(which gunzip)" != "" ]]
38+
then
39+
echo "Using wget and gunzip"
40+
wget -q -O /tmp/piduck.zip https://github.com/gitdev-bash/piduck/tarball/master/
41+
tar -xzvf /tmp/piduck.tar.gz
42+
rm /tmp/piduck.tar.gz
43+
elif [[ "$(which curl)" != "" && "$(which gunzip)" != "" ]]
44+
then
45+
echo "Using curl and gunzip"
46+
curl -sSL -o /tmp/piduck.zip https://github.com/gitdev-bash/piduck/tarball/master/
47+
tar -xzvf /tmp/piduck.tar.gz
48+
rm /tmp/piduck.tar.gz
2049
else
21-
if [[ "$(which git)" != "" ]]
22-
then
23-
echo "Using git!"
24-
git clone https://github.com/gitdev-bash/piduck.git /tmp/piduck
25-
elif [[ "$(which wget)" != "" && "$(which unzip)" != "" ]]
26-
then
27-
echo "Using wget and unzip"
28-
wget -q -O /tmp/piduck.zip https://github.com/gitdev-bash/piduck/zipball/master/
29-
unzip /tmp/piduck.zip
30-
rm /tmp/piduck.zip
31-
elif [[ "$(which curl)" != "" && "$(which unzip)" != "" ]]
32-
then
33-
echo "Using curl and unzip"
34-
curl -sSL -o /tmp/piduck.zip https://github.com/gitdev-bash/piduck/zipball/master/
35-
unzip /tmp/piduck.zip
36-
rm /tmp/piduck.zip
37-
elif [[ "$(which wget)" != "" && "$(which gunzip)" != "" ]]
38-
then
39-
echo "Using wget and gunzip"
40-
wget -q -O /tmp/piduck.zip https://github.com/gitdev-bash/piduck/tarball/master/
41-
tar -xzvf /tmp/piduck.tar.gz
42-
rm /tmp/piduck.tar.gz
43-
elif [[ "$(which curl)" != "" && "$(which gunzip)" != "" ]]
44-
then
45-
echo "Using curl and gunzip"
46-
curl -sSL -o /tmp/piduck.zip https://github.com/gitdev-bash/piduck/tarball/master/
47-
tar -xzvf /tmp/piduck.tar.gz
48-
rm /tmp/piduck.tar.gz
49-
else
50-
echo "Ops missing dependencies"
51-
exit 2
52-
fi
53-
mkdir /etc/piduck
54-
mv /tmp/piduck/piduck.py /etc/piduck/piduck.py
55-
mv /tmp/piduck/pd_key_maps /etc/piduck/pd_key_maps
56-
mv /tmp/piduck/requirements.txt /etc/piduck/requirements.txt
57-
chmod 555 /etc/piduck/piduck.py /etc/piduck/pd_key_maps/*
58-
chmod 444 /etc/piduck/pd_key_maps/* /etc/piduck/requirements.txt
59-
rm -rf /tmp/piduck
60-
ln -s /etc/piduck/piduck.py /usr/bin/piduck
50+
echo "Ops missing dependencies"
51+
exit 2
6152
fi
53+
mkdir /etc/piduck
54+
mv /tmp/piduck/piduck.py /etc/piduck/piduck.py
55+
mv /tmp/piduck/pd_key_maps /etc/piduck/pd_key_maps
56+
mv /tmp/piduck/requirements.txt /etc/piduck/requirements.txt
57+
chmod 555 /etc/piduck/piduck.py /etc/piduck/pd_key_maps/*
58+
chmod 444 /etc/piduck/pd_key_maps/* /etc/piduck/requirements.txt
59+
rm -rf /tmp/piduck
60+
ln -s /etc/piduck/piduck.py /usr/bin/piduck
61+
#fi
6262
echo "DONE!"
6363
exit 0

0 commit comments

Comments
 (0)