Hi,
Posted: 23 Dec 2010 12:31
I am new to the Dos Scripting,
I need small script which is equivalent to the shell scripting.
Description of the script -> below script use to restart the server.
$cat a.sh
cd / # change directory to root
net stop "OneBridge Sync Server" > a.log # command which used to stop the server
if [ $? = 0 ] # checking whether the last command is success or not
then
net start "OneBridge Sync Server" >> a.log # if stop is success then start the server
if [ $? = 0 ]
then
mailx -s "Successfully restarted" <mailid> < a.log # sending mail for success of restart
else
mailx -s "Failure of starting" <mailid> < a.log # failure while starting
fi
else
mailx -s "Failure of stopping" <mailid> < a.log # failure while stopping
fi
Please provide the equivalent Dos Script.
By
Ganesh.
I need small script which is equivalent to the shell scripting.
Description of the script -> below script use to restart the server.
$cat a.sh
cd / # change directory to root
net stop "OneBridge Sync Server" > a.log # command which used to stop the server
if [ $? = 0 ] # checking whether the last command is success or not
then
net start "OneBridge Sync Server" >> a.log # if stop is success then start the server
if [ $? = 0 ]
then
mailx -s "Successfully restarted" <mailid> < a.log # sending mail for success of restart
else
mailx -s "Failure of starting" <mailid> < a.log # failure while starting
fi
else
mailx -s "Failure of stopping" <mailid> < a.log # failure while stopping
fi
Please provide the equivalent Dos Script.
By
Ganesh.