- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2007 05:13 PM
09-15-2007 05:13 PM
script question
I'm not a scripting person.I have an application script.And wanted to set it up for start at boot.I have copied the script to appropriate dir and created links.And posted a script here.Could some one take a look and please advice if it looks right in general.Really appreciate you.
Thanks
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: $0 {start|stop|restart}"
exit 1
fi
SWSBIN=/export/home/application/swt/sws/sws2007/bin
case "$1" in
'start')
echo "Starting sws"
/bin/su sws -c $SWSBIN/sws start
;;
'stop')
echo "Stopping sws"
/bin/su sws -c $SWSBIN/sws stop
;;
esac
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2007 05:45 PM
09-15-2007 05:45 PM
Re: script question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2007 06:03 PM
09-15-2007 06:03 PM
Re: script question
restart)
echo "Restarting sws"
/bin/su sws -c $SWSBIN/sws stop
/bin/su sws -c $SWSBIN/sws start
;;
status)
ps -ef |grep
;;
The status should be modified so the script is able to report if the service is running or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2007 07:29 PM
09-15-2007 07:29 PM
Re: script question
http://docs.hp.com/en/B2355-60130/rc.1M.html
It needs: start stop start_msg stop_msg
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1140119
>'start')
There is no need to quote those patterns.
>/bin/su sws -c $SWSBIN/sws start
The string after -c must be quoted if more than one token:
/bin/su sws -c "$SWSBIN/sws start"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2007 12:46 AM
09-16-2007 12:46 AM
Re: script question
I will be testing this tomorrow.Until that i would like to keep this thread open .Then surey i will assign the points .
Thanks again for taking time to reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2007 12:51 AM
09-16-2007 12:51 AM
Re: script question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2007 03:05 AM
09-17-2007 03:05 AM
Re: script question
to be HP-UX complaint, you'd have to code the additional options
start_msg) echo Starting xxx ;;
stop_msg) echo Stopping xxx ;;
mfG Peter