eole-lemonldap/posttemplate/70-lemonldap-ng-hosts
Daniel Dehennin dec2cb8e79 Harmonize script names
Ref: #30852
2020-10-14 13:18:54 +02:00

19 lines
442 B
Bash
Executable File

#!/bin/bash
ENABLE=$(CreoleGet activerLemon 'non')
HOSTS="/etc/hosts"
if [ "${ENABLE}" = 'oui' ];then
manager=$(CreoleGet managerWebName)
handler=$(CreoleGet reloadWebName)
portal=$(CreoleGet authWebName)
ipaddr=$(CreoleGet adresse_ip_eth0)
line="${ipaddr} ${manager} ${handler} ${portal}"
grep -q "${line}" ${HOSTS}
if [[ ${?} -eq 0 ]]
then
exit 0
else
echo ${line} >> ${HOSTS}
fi
fi