mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 13:54:26 -07:00
adding some flexibilty
This commit is contained in:
parent
61fe8fc2a9
commit
2c420440ac
1 changed files with 11 additions and 7 deletions
|
@ -25,12 +25,6 @@ source $VESTA/conf/vesta.conf
|
||||||
|
|
||||||
check_args '2' "$#" 'KEY VALUE'
|
check_args '2' "$#" 'KEY VALUE'
|
||||||
validate_format 'key'
|
validate_format 'key'
|
||||||
check_ckey=$(grep "^$key='" $VESTA/conf/vesta.conf)
|
|
||||||
if [ -z "$check_ckey" ]; then
|
|
||||||
echo "Error: key $key not found"
|
|
||||||
log_event "$E_INVALID" "$EVENT"
|
|
||||||
exit $E_INVALID
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
@ -38,7 +32,17 @@ fi
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Updating conf
|
# Updating conf
|
||||||
sed -i "s/$key=.*/$key='$value'/g" $VESTA/conf/vesta.conf
|
check_ckey=$(grep "^$key='" $VESTA/conf/vesta.conf)
|
||||||
|
if [ -z "$check_ckey" ]; then
|
||||||
|
echo "$key='$value'" >> $VESTA/conf/vesta.conf
|
||||||
|
else
|
||||||
|
sed -i "s|$key=.*|$key='$value'|g" $VESTA/conf/vesta.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$key" = "BACKUP" ] && [ "$value" != '/backup' ]; then
|
||||||
|
rm /backup
|
||||||
|
ln -s $value /backup
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue