milis/bin/servis
2018-07-15 09:38:46 +03:00

25 行
508 B
Bash
実行ファイル
Raw Blame 履歴

このファイルには曖昧(ambiguous)なUnicode文字が含まれています

このファイルには、他の文字と見間違える可能性があるUnicode文字が含まれています。 それが意図的なものと考えられる場合は、この警告を無視して構いません。 それらの文字を表示するにはエスケープボタンを使用します。

#!/bin/bash
if [ -z "$1" ]; then
echo "kullanım: servis <servicename> start|stop|restart"
exit 1
else
_servis=$1
if [ ! -f /etc/init.d/$_servis ]; then
echo "$_servis servisi bulunamadı."
exit 1
fi
fi
if [ -z "$2" ]; then
echo "kullanım: servis <servicename> start|stop|restart|status|durum"
exit 1
else
_islev=$2
fi
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