following are the contents of was-start script which i am running it manually once server is fully up after reboot. but i wanted to auto start this " was-start " script using " wasadmin " user . Anyone can help me on this ??
was-start script
-------------------
#!/bin/sh
# add new server anme onto the ServerList below. Make you add a space between each server name
Server=server1
#=============== DO NOT CHANGE ANY CODE BELOW ===================
WS_ROOTDIR="/opt/IBM/WebSphere/AppServer"
WS_DIR="$WS_ROOTDIR/profiles/AppSrv01/bin"
. $WS_DIR/dj_params.sh
if [ $USERNAME != "wasadmin" ]
then
echo ""
echo "Must login as wasadmin"
echo ""
exit 1;
fi
if [ -z "$ROOTDIR" -o ! -d "$ROOTDIR" ]
then
echo "ERROR: ROOTDIR=[$ROOTDIR] is empty or invalid"
exit 1
fi
echo "start server :==========> $Server"
$WS_DIR/startServer.sh $Server
sleep 2
echo ""
echo "Checking for any WebSphere process is still running"
ps -ef | grep "$ROOTDIR"
echo ""
echo "Total WebSphere proccesses are currently running"
ps -ef| grep "$ROOTDIR"| grep -v grep | wc -l
exit 0
--------------------
end script
------------------------
was-start script
-------------------
#!/bin/sh
# add new server anme onto the ServerList below. Make you add a space between each server name
Server=server1
#=============== DO NOT CHANGE ANY CODE BELOW ===================
WS_ROOTDIR="/opt/IBM/WebSphere/AppServer"
WS_DIR="$WS_ROOTDIR/profiles/AppSrv01/bin"
. $WS_DIR/dj_params.sh
if [ $USERNAME != "wasadmin" ]
then
echo ""
echo "Must login as wasadmin"
echo ""
exit 1;
fi
if [ -z "$ROOTDIR" -o ! -d "$ROOTDIR" ]
then
echo "ERROR: ROOTDIR=[$ROOTDIR] is empty or invalid"
exit 1
fi
echo "start server :==========> $Server"
$WS_DIR/startServer.sh $Server
sleep 2
echo ""
echo "Checking for any WebSphere process is still running"
ps -ef | grep "$ROOTDIR"
echo ""
echo "Total WebSphere proccesses are currently running"
ps -ef| grep "$ROOTDIR"| grep -v grep | wc -l
exit 0
--------------------
end script
------------------------