File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22#
3+ export SHELLOPTS
34BASE_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) "
45
56. " ${BASE_DIR} /utils.sh"
@@ -19,13 +20,16 @@ function pre_install() {
1920 log_error " $( gettext ' command not found, Please install it first' ) iptables"
2021 exit 1
2122 fi
22- if command -v python& > /dev/null; then
23- :
24- elif command -v python2& > /dev/null; then
25- :
26- elif command -v python3& > /dev/null; then
27- :
28- else
23+
24+ found=0
25+ for cmd in python python2 python3; do
26+ if command -v " $cmd " & > /dev/null; then
27+ found=1
28+ break
29+ fi
30+ done
31+
32+ if [ $found -eq 0 ]; then
2933 log_error " $( gettext ' command not found, Please install it first' ) python"
3034 exit 1
3135 fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22#
3+ export SHELLOPTS
4+
35BASE_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) "
46
57. " ${BASE_DIR} /utils.sh"
You can’t perform that action at this time.
0 commit comments