#!/bin/bash # info: restart service # options: service # # The function restarts system service. #----------------------------------------------------------# # Variable&Function # #----------------------------------------------------------# # Argument defenition service=$1 # Includes source $VESTA/func/main.sh #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# check_args '1' "$#" 'SERVICE' #----------------------------------------------------------# # Action # #----------------------------------------------------------# if [ "$service" != "iptables" ]; then service $service restart >/dev/null 2>&1 if [ $? -ne 0 ]; then exit $E_RESTART fi else $BIN/v-stop-firewall $BIN/v-update-firewall if [ $? -ne 0 ]; then exit $E_RESTART fi fi #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# exit