Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #!/bin/bash
  2. if [ "$1" == "" ]
  3. then
  4. echo "SID must be first parameter"
  5. exit 1
  6. fi
  7.  
  8. LCDB=$(echo $2 | awk '{print tolower($0)}')
  9.  
  10. if [ "$LCDB" != "db2" ]
  11. then
  12. echo "Supported DB must be second parameter"
  13. exit 1
  14. fi
  15.  
  16. LCSID=$(echo $1 | awk '{print tolower($0)}')
  17. UCSID=$(echo $1 | awk '{print toupper($0)}')
  18.  
  19. SIDADM=${LCSID}adm
  20. DBUSER=${LCDB}${LCSID}
  21. SCHEMAUSER="sapr3"
  22.  
  23. echo $LCSID $UCSID $SIDADM $SCHEMAUSER $DBUSER
  24.  
  25. USERLIST="$SIDADM $SCHEMAUSER $DBUSER"
  26.  
  27. for USER in $USERLIST
  28. do
  29. set -x
  30. chage -l $USER
  31. chage -M 9999 $USER
  32. chage -E 1 $USER
  33. chage -l $USER
  34.  
  35. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement