#!/bin/bash SERVICE=$1 #only restart it its up currently if ! svstat $SERVICE | grep ': down' >/dev/null; then svcstop $SERVICE || exit 1 svcstart $SERVICE || exit 1 fi