vesta/bin/v-stop-service
2013-01-19 23:07:26 +02:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# info: stop service
# options: service
#
# The function stops system service.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
service=$1
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'SERVICE'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ -x "/etc/init.d/$service" ]; then
/etc/init.d/$service stop >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit