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