servis
This commit is contained in:
parent
80b1c3cfad
commit
1da9b758e8
18
bin/servis
18
bin/servis
|
@ -3,11 +3,23 @@
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "kullanım: servis <servicename> start|stop|restart"
|
echo "kullanım: servis <servicename> start|stop|restart"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
_servis=$1
|
||||||
|
if [ ! -f /etc/init.d/$_servis ]; then
|
||||||
|
echo "$_servis servisi bulunamadı."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /etc/init.d/$1 ]; then
|
if [ -z "$2" ]; then
|
||||||
echo "$1 servisi bulunamadı."
|
echo "kullanım: servis <servicename> start|stop|restart|status|durum"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
_islev=$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/etc/init.d/$1 $2
|
if [ $2 == "durum" ];then
|
||||||
|
servis $_servis status | grep 'is running' > /dev/null && [ $? -eq 0 ] && echo "aktif" || echo "pasif"
|
||||||
|
else
|
||||||
|
/etc/init.d/$_servis $_islev
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue