I have a problem to write script for checking server. Anyway my script sticks on "shell" line of code.
When I execute command "shell" inside of script, it won't go further to other command. so basically look like this:
#!/bin/sh
#exec > output.txt
echo -en '\n'
echo -en '\n'
echo "-------------------------- Daily Check Script ------------------------------"
echo " MYteam"
echo -en '\n'
echo "CHECK MASTER/SLAVE node----------------------------------------------------"
echo -en '\n'
var="$(hbmode status )"
if [[ $var =~ "M_WITH_S / S_WITH_M" ]]; then
echo "You are on MASTER node"
else
echo "You are on SLAVE node"
fi
current_date=$(date)
echo -en '\n'
echo "Today is ---------------------------------------------------------------"
#echo -en '\n'
echo "Today is $current_date"
echo -en '\n'
echo "Checking SERVER VIP active-----------------------------------------"
shell
After "shell" command, I get this:
Local controller version is 3.0.0
Usage : Type <tab> or help for commands and completion.
server1.it.sunburning.gr>
I need to type command: vdip route show
but script won't execute this command.
How can I inside of script execute shell
and vdip route show
command, and exit from shell afterwards to execute other commands like , df -h
, free -m
etc....
I want to use this script in Cron.