Need script to restart the services

Hi Guys,

I need bash script to restart the service.

  1. Disable the service called SASM

svcadm disable sasm

  1. if service went to maintenance mode then it shuld clear it with below command

svcadm clear sasm

3.or else it should restart the mysql service

/etc/init.d/mysql stop
/etc/init.d/mysql start

  1. finally start the SASM

svcadm enable sasm

Hi

You may take help from /etc/init.d/<any script>

refer the scripts from this directory and implement your script accordingly which does stopping starting restarting of services. Use only for reference