Knowledge Base
Bash Script to Check and restart services in linux
#!/bin/bash
read -p "Enter Your Service " x
y=(/etc/init.d/$x status)
a=(pgrep $y)
if [ ! $a==0 ]
then
echo "Service Loading FINE"
else
/etc/init.d/$x restart
fi
Newer Post
Older Post
Home