瀏覽代碼

[Update.sh] Move dependencies to loop

andryyy 8 年之前
父節點
當前提交
538a99b956
共有 1 個文件被更改,包括 3 次插入6 次删除
  1. 3 6
      update.sh

+ 3 - 6
update.sh

@@ -1,11 +1,8 @@
 #!/bin/bash
 #!/bin/bash
 
 
-if [[ -z $(which curl) ]]; then echo "Cannot find curl, exiting."; exit 1; fi
-if [[ -z $(which docker-compose) ]]; then echo "Cannot find docker-compose, exiting."; exit 1; fi
-if [[ -z $(which docker) ]]; then echo "Cannot find docker, exiting."; exit 1; fi
-if [[ -z $(which git) ]]; then echo "Cannot find git, exiting."; exit 1; fi
-if [[ -z $(which awk) ]]; then echo "Cannot find awk, exiting."; exit 1; fi
-if [[ -z $(which sha1sum) ]]; then echo "Cannot find sha1sum, exiting."; exit 1; fi
+for bin in curl docker-compose docker git awk sha1sum; do
+	if [[ -z $(which ${bin}) ]]; then echo "Cannot find ${bin}, exiting..."; exit 1; fi
+done
 
 
 CONFIG_ARRAY=("SKIP_LETS_ENCRYPT" "SKIP_CLAMD" "SKIP_IP_CHECK" "SKIP_FAIL2BAN" "ADDITIONAL_SAN" "DOVEADM_PORT")
 CONFIG_ARRAY=("SKIP_LETS_ENCRYPT" "SKIP_CLAMD" "SKIP_IP_CHECK" "SKIP_FAIL2BAN" "ADDITIONAL_SAN" "DOVEADM_PORT")
 echo >> mailcow.conf
 echo >> mailcow.conf