Update v-change-vesta-port

This commit is contained in:
dpeca 2019-08-24 15:55:29 +02:00 committed by GitHub
commit e902b0180b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,23 +15,19 @@ if [ -z "$VESTA" ]; then
VESTA="/usr/local/vesta" VESTA="/usr/local/vesta"
fi fi
if [ ! -f "$VESTA/conf/port.conf" ]; then # Get current vesta port by reading nginx.conf
oldport=$(grep 'listen' $VESTA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
if [ -z "$oldport" ]; then
oldport=8083 oldport=8083
else
oldport=`cat $VESTA/conf/port.conf`
fi fi
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------# #----------------------------------------------------------#
# Verifications # # Verifications #
#----------------------------------------------------------# #----------------------------------------------------------#
whoami=$(whoami) # Checking permissions
if [ "$whoami" != "root" ] && [ "$whoami" != "admin" ] ; then if [ "$(id -u)" != '0' ]; then
echo "You must be root or admin to execute this script"; check_result $E_FORBIDEN "You must be root to execute this script"
exit 1;
fi fi
check_args '1' "$#" 'PORT' check_args '1' "$#" 'PORT'