From 49f99bf831d39e64d730823283f18e242bc3342f Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Tue, 1 Nov 2016 20:49:13 +0100 Subject: [PATCH] exit if not working --- static/phpmyadmin_install_ubuntu16.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/static/phpmyadmin_install_ubuntu16.sh b/static/phpmyadmin_install_ubuntu16.sh index da988ba9..751a78af 100644 --- a/static/phpmyadmin_install_ubuntu16.sh +++ b/static/phpmyadmin_install_ubuntu16.sh @@ -53,6 +53,7 @@ fi echo echo "Installing and securing phpMyadmin..." +echo "This may take a while, please don't abort." echo sleep 2 @@ -169,10 +170,14 @@ cat << CONFIG_CREATE >> "$CONFIG" CONFIG_CREATE service apache2 restart - -echo -echo "$PHPMYADMIN_CONF was successfully secured." -echo -sleep 3 - -exit 0 +if [[ $? > 0 ]] +then + echo "Apache2 could not restart..." + echo "The script will exit." + exit 1 +else + echo + echo "$PHPMYADMIN_CONF was successfully secured." + echo + sleep 3 +fi