|
13 | 13 | fi
|
14 | 14 | exit $?
|
15 | 15 | 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)" != "" ]] |
17 | 22 | 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 |
20 | 49 | 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 |
61 | 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 |
| 61 | +#fi |
62 | 62 | echo "DONE!"
|
63 | 63 | exit 0
|
0 commit comments