am having issue with grep as VESTACP is using it a lot.
i have file mysql.conf
HOST='localhost' USER='root' PASSWORD='xxxxxx' CHARSETS='UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8' MAX_DB='500' U_SYS_USERS='' U_DB_BASES='1' SUSPENDED='no' TIME='05:32:47' DATE='2016-03-20'
now when i run
echo host_str=$(grep "HOST='$1'" $VESTA/conf/mysql.conf)
i get empty result , although there is HOST in mysql.conf file which i pasted above in code
so any idea whats wrong with it
UPDATE :: Vesta db connect code block
host_str=$(grep "HOST='$1'" $VESTA/conf/mysql.conf)
eval $host_str
if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
echo "Error: mysql config parsing failed"
log_event "$E_PARSING" "$EVENT"
exit $E_PARSING
fi
and i get
Error: mysql config parsing failed
$1and check the value?$1is empty then you are effectively runninggrep "HOST=''" $VESTA/conf/mysql.confcommand