mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
43 lines
1.1 KiB
Bash
Executable file
43 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
# info: stop service
|
|
# options: service
|
|
#
|
|
# The function stops system service.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
service=$1
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '1' "$#" 'SERVICE'
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
if [ "$service" != 'iptables' ]; then
|
|
service $service stop >/dev/null 2>&1
|
|
check_result $? "$service stop failed" $E_RESTART
|
|
else
|
|
$BIN/v-stop-firewall
|
|
check_result $? "$service stop failed" $E_RESTART
|
|
fi
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
exit
|