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

72
winbind Executable file
View File

@@ -0,0 +1,72 @@
#!/bin/sh
#
CONFIG=/etc/config/smb.conf
# Check that smb.conf exists.
[ -f $CONFIG ] || exit 0
start() {
echo -n "Starting winbindd services:"
if [ `/sbin/getcfg Samba Enable -u -d TRUE` = FALSE ]; then
echo " disabled."
exit 0
fi
RETVAL=1
/bin/grep -i idmap $CONFIG >/dev/null 2>&1
RETIDMAP=$?
/bin/grep -i winbind.*uid $CONFIG >/dev/null 2>&1
RETWINBIND=$?
if [ $RETIDMAP = 0 ] || [ $RETWINBIND = 0 ]; then
/sbin/daemon_mgr winbindd start "/usr/local/samba/sbin/winbindd -s $CONFIG"
/bin/touch /etc/krb5.keytab
/bin/chmod 666 /mnt/HDA_ROOT/.domain_*
RETVAL=$?
fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || RETVAL=1
if [ "$RETVAL" = "0" ]; then echo " winbindd."; fi
idmap_rid=`/sbin/getcfg Samba "idmap_rid" -d "FALSE"`
if [ "$idmap_rid" = "FALSE" ]; then
/bin/cat /etc/config/crontab | /bin/grep idmap.sh > /dev/null
if [ $? -ne 0 ]; then
echo "0 3 * * 0 /etc/init.d/idmap.sh dump" >> /etc/config/crontab
/usr/bin/crontab /etc/config/crontab
fi
fi
return $RETVAL
}
stop() {
echo -n "Shutting down winbindd services:"
# winbinddpids=`ps guax | grep winbindd | grep -v grep | awk '{print $1}'`
# for pid in $winbinddpids; do
# kill -TERM $pid
# done
/sbin/daemon_mgr winbindd stop "/usr/local/samba/sbin/winbindd"
echo " winbindd."
/bin/sleep 1
/bin/pidof winbindd 1>>/dev/null 2>>/dev/null
[ $? != 0 ] || /bin/kill `/bin/pidof winbindd`
[ ! -f /var/lock/subsys/winbind ] || rm -f /var/lock/subsys/winbind
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?