Combine calls to restart nginx into a single command
This commit is contained in:
@@ -9,6 +9,18 @@ set +e
|
|||||||
NO_VHOST=$(dokku config:get $APP NO_VHOST)
|
NO_VHOST=$(dokku config:get $APP NO_VHOST)
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
restart_nginx () {
|
||||||
|
case "$DOKKU_DISTRO" in
|
||||||
|
ubuntu)
|
||||||
|
sudo /etc/init.d/nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
sudo /sbin/service nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -n "$NO_VHOST" ]]; then
|
if [[ -n "$NO_VHOST" ]]; then
|
||||||
echo "-----> NO_VHOST config detected"
|
echo "-----> NO_VHOST config detected"
|
||||||
fi
|
fi
|
||||||
@@ -103,15 +115,7 @@ EOF
|
|||||||
pluginhook nginx-pre-reload $APP $PORT
|
pluginhook nginx-pre-reload $APP $PORT
|
||||||
|
|
||||||
echo " Reloading nginx"
|
echo " Reloading nginx"
|
||||||
case "$DOKKU_DISTRO" in
|
restart_nginx
|
||||||
ubuntu)
|
|
||||||
sudo /etc/init.d/nginx reload > /dev/null
|
|
||||||
;;
|
|
||||||
|
|
||||||
opensuse)
|
|
||||||
sudo /sbin/service nginx reload > /dev/null
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
else
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||||
echo "------> NO_VHOST set, deleting $APP/URL"
|
echo "------> NO_VHOST set, deleting $APP/URL"
|
||||||
@@ -121,14 +125,6 @@ else
|
|||||||
echo "------> NO_VHOST set, deleting $APP/nginx.conf"
|
echo "------> NO_VHOST set, deleting $APP/nginx.conf"
|
||||||
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
||||||
echo "------> NO_VHOST set, reloading nginx after nginx.conf deletion"
|
echo "------> NO_VHOST set, reloading nginx after nginx.conf deletion"
|
||||||
case "$DOKKU_DISTRO" in
|
restart_nginx
|
||||||
ubuntu)
|
|
||||||
sudo /etc/init.d/nginx reload > /dev/null
|
|
||||||
;;
|
|
||||||
|
|
||||||
opensuse)
|
|
||||||
sudo /sbin/service nginx reload > /dev/null
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user