- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- password aging script in trusted systems
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
Discussions
Discussions
Forums
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
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
тАО01-18-2011 03:13 AM
тАО01-18-2011 03:13 AM
password aging script in trusted systems
I just got this script in one of the threads, for password expiry notification.
I would like to know what current_time has to be set, as i am getting error in my script.
USER=someusername
exp=$(logins -x -l $USER | tail -1 | awk '{print $4}')
((exp_time = exp * 86400))
last_change=$(grep u_succhg /tcb/files/auth/$U/$USER | \
awk -F "u_succhg#" ' {print $2}' |\
awk -F ":" ' {print $1}' )
((exp_date = last_change + exp_time))
((time_left = exp_date - current_time))
((days_left = time_left / 86400))
Script returns,
ofadr-6CPU@DB>./passwdexp1.sh
./passwdexp1.sh[24]: 15:09:03: Syntax error
Attached is the actual script that i run.
- Tags:
- password aging
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 03:42 AM
тАО01-18-2011 03:42 AM
Re: password aging script in trusted systems
Looks like an aritmetic operator is trying to use the "15:09:03" value. Try execute it again ussing the trace option, is useful to debug:
ofadr-6CPU@DB>sh -x passwdexp1.sh
Waiting for your next post.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 03:47 AM
тАО01-18-2011 03:47 AM
Re: password aging script in trusted systems
Attached is the output. Looks like a same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 03:59 AM
тАО01-18-2011 03:59 AM
Re: password aging script in trusted systems
Also suggest you an echo of all variables belonging at formulas previous the IF.
Then run it again with debug option.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 04:27 AM
тАО01-18-2011 04:27 AM
Re: password aging script in trusted systems
Previous post is just for debuging...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2011 02:36 AM
тАО01-19-2011 02:36 AM
Re: password aging script in trusted systems
Figured it out!! Attached is the script which works fine, but it requires perl to be installed in the system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2011 02:37 AM
тАО01-19-2011 02:37 AM