File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,24 @@ source $VESTA/conf/vesta.conf
2525
2626check_args ' 2' " $# " ' KEY VALUE'
2727validate_format ' key'
28- check_ckey=$( grep " ^$key ='" $VESTA /conf/vesta.conf)
29- if [ -z " $check_ckey " ]; then
30- echo " Error: key $key not found"
31- log_event " $E_INVALID " " $EVENT "
32- exit $E_INVALID
33- fi
3428
3529
3630# ----------------------------------------------------------#
3731# Action #
3832# ----------------------------------------------------------#
3933
4034# Updating conf
41- sed -i " s/$key =.*/$key ='$value '/g" $VESTA /conf/vesta.conf
35+ check_ckey=$( grep " ^$key ='" $VESTA /conf/vesta.conf)
36+ if [ -z " $check_ckey " ]; then
37+ echo " $key ='$value '" >> $VESTA /conf/vesta.conf
38+ else
39+ sed -i " s|$key =.*|$key ='$value '|g" $VESTA /conf/vesta.conf
40+ fi
41+
42+ if [ " $key " = " BACKUP" ] && [ " $value " != ' /backup' ]; then
43+ rm /backup
44+ ln -s $value /backup
45+ fi
4246
4347
4448# ----------------------------------------------------------#
You can’t perform that action at this time.
0 commit comments