#!/bin/bash
# Subject:- To check service is on or off.
#Developed by DEEPAK G GHULE
#Date 13/10/2009
date
echo "Plz Enter service name for service status:"
read service
ps -C $service &>/dev/null
if [ $? -eq 0 ]; then
echo "$service is running"
else
echo "$service is not running"
fi
PS3="Please select the option to restart the $service Yes[1]/No[2]:"
LIST="Yes No"
select i in $LIST
do
if [ $i = "Yes" ]; then
chkconfig --level 35 $service on
/etc/init.d/$service restart &>/dev/null
echo $service is running now
elif [ $i = "No" ]; then
chkconfig --list | grep $service
fi
break
done
Blog Archive
-
▼
2009
(8)
-
▼
October
(8)
- Sending mails using the command line
- Let us ping range of IPs machine
- Useradd via shell script IN Linux
- To check desire machine status for up or down by I...
- To know Disk space Alert by mail in Linux
- Access Windows shares from the terminal
- Aircel/Airtel GPRS on linux via USB cable/bluetoot...
- To check Linux service is on or off
-
▼
October
(8)