1

Add original scripts

This commit is contained in:
eleksir
2016-09-04 22:20:40 +03:00
commit 8e3af042d2
128 changed files with 19003 additions and 0 deletions

29
ads_register_dns.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
GETCFG="/sbin/getcfg"
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
try=0
while [ $try -lt 3 ]; do
${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
fi
fi
}
ads_register_dns