simplified way to manage system services

This commit is contained in:
Serghey Rodin 2014-05-16 21:41:50 +03:00
commit c81a2bf123
4 changed files with 12 additions and 47 deletions

View file

@ -27,16 +27,9 @@ check_args '1' "$#" 'SERVICE'
# Action #
#----------------------------------------------------------#
if [ -x "/etc/init.d/$service" ]; then
/etc/init.d/$service start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
service $service start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
service $service start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi