19
posttemplate/70-lemonldap-ng-hosts
Executable file
19
posttemplate/70-lemonldap-ng-hosts
Executable file
@ -0,0 +1,19 @@
|
||||
#!/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
|
Reference in New Issue
Block a user