Fix v-update-sys-ip: verify if primary IP exists

Fixes the following errors on new installations:

> mv: cannot move '/usr/local/vesta/data/ips/' to a subdirectory of itself, '/usr/local/vesta/data/ips/x.x.x.x'
> sed: can't read /usr/local/vesta/data/users/*/dns/*.conf: No such file or directory
> sed: -e expression #1, char 0: no previous regular expression
> sed: -e expression #1, char 0: no previous regular expression
This commit is contained in:
Hacktivista 2018-11-07 15:31:01 -03:00
commit 9abd3baf2e

View file

@ -44,7 +44,7 @@ if [[ "$ip_num" -eq '1' ]] && [[ "$v_ip_num" -eq 1 ]]; then
fi
# Updating configs
if [ ! -z "$new" ]; then
if [ ! -z "$old" ]; then
mv $VESTA/data/ips/$old $VESTA/data/ips/$new
# Updating PROXY