1

cleanup ads_register_dns.sh

This commit is contained in:
eleksir
2016-09-04 22:42:31 +03:00
parent fdf6abbc22
commit a475f9df24

View File

@@ -4,20 +4,24 @@ NET="/usr/local/samba/bin/net"
quiet="$1"
ads_register_dns() {
_ads=`${GETCFG} global security -d USER -f /etc/config/smb.conf`
if [ "x${_ads}" = "xADS" ]; then
_reg_dns=`${GETCFG} Samba "register dns" -d FALSE`
if [ "x${_reg_dns}" = "xTRUE" ]; then
_ads="$(${GETCFG} global security -d USER -f /etc/config/smb.conf)"
if [ "${_ads}" == "ADS" ]; then
_reg_dns="$(${GETCFG} Samba "register dns" -d FALSE)"
if [ "${_reg_dns}" == "TRUE" ]; then
try=0
while [ $try -lt 3 ]; do
${NET} ads dns register -P
if [ $? = 0 ]; then
"${NET}" ads dns register -P
if [ $? == 0 ]; then
[ "$quiet" == "" ] && /sbin/write_log "[Microsoft Networking] The NAS has been registered successfully in DNS" 4
break
fi
/bin/sleep 1
let "try++"
done
if [ $try -ge 3 ]; then
/sbin/write_log "[Microsoft Networking] The NAS registration in DNS failed" 2
fi