Merge changes from upstream

I'm a little angry
This commit is contained in:
ZonD Eighty 2012-12-28 23:31:02 +04:00
commit 2b16d9bd83
254 changed files with 24485 additions and 24094 deletions

View file

@ -1,51 +1,51 @@
#!/bin/bash
# info: change sysconfig value
# options: key value
#
# The function is for changing main config settings such as COMPANY_NAME or
# COMPANY_EMAIL and so on.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
key=$(echo "$1" | tr '[:lower:]' '[:upper:]' )
value=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'key value'
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
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Updating conf
sed -i "s/$key=.*/$key='$value'/g" $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit
#!/bin/bash
# info: change sysconfig value
# options: KEY VALUE
#
# The function is for changing main config settings such as COMPANY_NAME or
# COMPANY_EMAIL and so on.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
key=$(echo "$1" | tr '[:lower:]' '[:upper:]' )
value=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'KEY VALUE'
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
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Updating conf
sed -i "s/$key=.*/$key='$value'/g" $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit