diff options
author | Daniel Hansson <daniel@techandme.se> | 2017-07-11 17:59:33 +0300 |
---|---|---|
committer | Daniel Hansson <daniel@techandme.se> | 2017-07-11 18:57:19 +0300 |
commit | 44cdd3aea8b34b4b6c173a8227eb5f485f9c4cbf (patch) | |
tree | d3db29903e88e5680d739ea24e77ed23a33228ea /apps | |
parent | b0633c6f9da6ba422e19069115f7c030a2ee0223 (diff) |
install_if_not (#296)
Signed-off-by: Daniel Hansson <daniel@techandme.se>
modified: apps/collabora.sh
modified: apps/onlyoffice.sh
modified: apps/spreedme.sh
modified: lets-encrypt/activate-ssl.sh
modified: lib.sh
modified: nextcloud_update.sh
test
Diffstat (limited to 'apps')
-rw-r--r-- | apps/collabora.sh | 13 | ||||
-rw-r--r-- | apps/onlyoffice.sh | 15 | ||||
-rw-r--r-- | apps/spreedme.sh | 6 |
3 files changed, 4 insertions, 30 deletions
diff --git a/apps/collabora.sh b/apps/collabora.sh index 5adc96c2..7ae21d06 100644 --- a/apps/collabora.sh +++ b/apps/collabora.sh @@ -184,18 +184,7 @@ docker pull collabora/code docker run -t -d -p 127.0.0.1:9980:9980 -e "domain=$NCDOMAIN" --restart always --cap-add MKNOD collabora/code # Install Apache2 -if [ "$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed")" == "1" ] -then - sleep 0.1 -else - { - i=1 - while read -r line; do - ((i++)) - echo $i - done < <(apt install apache2 -y) - } | whiptail --title "Progress" --gauge "Please wait while installing Apache2" 6 60 0 -fi +install_if_not apache2 # Enable Apache2 module's a2enmod proxy diff --git a/apps/onlyoffice.sh b/apps/onlyoffice.sh index 25c2a655..3e58f0e9 100644 --- a/apps/onlyoffice.sh +++ b/apps/onlyoffice.sh @@ -183,19 +183,8 @@ fi docker pull onlyoffice/documentserver docker run -i -t -d -p 127.0.0.3:9090:80 -p 127.0.0.3:9091:443 --restart always onlyoffice/documentserver -# Install Apache2 -if [ "$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed")" == "1" ] -then - sleep 0.1 -else - { - i=1 - while read -r line; do - ((i++)) - echo $i - done < <(apt install apache2 -y) - } | whiptail --title "Progress" --gauge "Please wait while installing Apache2" 6 60 0 -fi +# Install apache2 +install_if_not apache2 # Enable Apache2 module's a2enmod proxy diff --git a/apps/spreedme.sh b/apps/spreedme.sh index bb15575b..6baa516e 100644 --- a/apps/spreedme.sh +++ b/apps/spreedme.sh @@ -28,11 +28,7 @@ then fi # Check if apache is installed -if ! [ "$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed")" -eq 1 ] -then - echo "Apache is not installed, the script will exit." - exit 1 -fi +install_if_not apache2 # Install Nextcloud Spreedme Snap if [ -d "$SNAPDIR" ] |