mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-22 06:14:19 -07:00
Update v-change-vesta-port
This commit is contained in:
parent
767e2d9021
commit
5a58fcfe6e
1 changed files with 6 additions and 14 deletions
|
@ -11,27 +11,19 @@
|
||||||
# Argument definition
|
# Argument definition
|
||||||
port=$1
|
port=$1
|
||||||
|
|
||||||
if [ -z "$VESTA" ]; then
|
# Get current vesta port by reading nginx.conf
|
||||||
VESTA="/usr/local/vesta"
|
oldport=$(grep 'listen' /usr/local/vesta/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
|
||||||
fi
|
if [ -z "$oldport" ]; then
|
||||||
|
|
||||||
if [ ! -f "$VESTA/conf/port.conf" ]; 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'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue