install.sh: Add for loop to shorten script.
License: MIT Signed-off-by: Stephan Kulla <git.mail@kulla.me>
Stephan Kulla committed
Sep 6, 2016 at 15:41 UTC
1f81933fb685e5a47a0e2c1c2a08f166af865151
1 file changed
+7
-13
cmd/ipfs/dist/install.sh
+7
-13
@@ -6,16 +6,10 @@ bin=ipfs
6
# it merely tries two locations.
7
# in the future maybe use value of $PATH.
8
9
-binpath=/usr/local/bin
10
-if [ -d "$binpath" ]; then
11
- mv "$bin" "$binpath/$bin"
12
- echo "installed $binpath/$bin"
13
- exit 0
14
-fi
15
-
16
-binpath=/usr/bin
17
-if [ -d "$binpath" ]; then
18
- mv "$bin" "$binpath/$bin"
19
- echo "installed $binpath/$bin"
20
- exit 0
21
-fi
9
+for binpath in /usr/local/bin /usr/bin; do
10
+ if [ -d "$binpath" ]; then
11
+ mv "$bin" "$binpath/$bin"
12
+ echo "installed $binpath/$bin"
13
+ exit 0
14
+ fi
15
+done