فهرست منبع

[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
 
-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")
 echo >> mailcow.conf