mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
51
bin/v-change-sys-config-value
Executable file
51
bin/v-change-sys-config-value
Executable file
|
@ -0,0 +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
|
Loading…
Add table
Add a link
Reference in a new issue