1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/zabbix_ynh.git synced 2024-09-03 20:36:14 +02:00

disable admin user (security issue)

This commit is contained in:
Mickael-Martin 2019-01-15 13:56:56 +01:00
parent 39e7880769
commit 96dc6fc4fb

View file

@ -48,6 +48,21 @@ if [ -z $final_path ]; then
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
fi fi
#=================================================
# Disable default admin for security issue
#=================================================
haveDefaultAdminEnabled=$(mysql -BN -u root -psMquHFoRof zabbix -e "SELECT count(id) from \`users_groups\` where userid=1 and usrgrpid=9")
if [ "$haveDefaultAdminEnabled" -eq 1 ] ;then
echo "Disable default admin"
#disable default admin
lastid=$(mysql -u$db_user -p$db_pwd $db_name -BN -e "SELECT max(id) from \`users_groups\`")
lastid=$(($lastid + 1 ))
mysql -u$db_user -p$db_pwd $db_name -e "INSERT INTO \`users_groups\` (\`id\` , \`usrgrpid\`, \`userid\`) VALUES ($lastid ,9, 1);"
else
echo "default admin already disabled"
fi
#================================================= #=================================================
# CHECK THE PATH # CHECK THE PATH
#================================================= #=================================================