Distroname and release: Linux / Unix

Be sure that samba is always running.

samba_check
#!/bin.sh
echo ""
echo "Samba Check script startet"
echo "http://www.linuxlasse.net"
echo ""
echo "Checking status on Samba"
if [ "$(id -u)" != "0" ]; then
echo "You are not root. Exiting"
exit 0
else

STATUS_DOWN="`ps -A |grep smbd |wc -l`"
if [ $STATUS_DOWN -eq "0" ]; then
        echo "WARNING: Asuming samba is down !!!"
        echo "Starting samba. Please wait...."
/etc/init.d/samba start
sleep 2
else
echo "samba is allready running"
fi
fi
sleep 1

Do not trust the authors words! POC, tests and experience is key

Copyright LinuxLasse.net 2009 - 2024 All Rights Reserved.

Valid HTML 4.01 Strict Valid CSS!