Initial add of defaria.com
[clearscm.git] / defaria.com / Computers / code / adm / bin / vobadm
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         vobadm
5 # Description:  A script run something as vobadm
6 # Author:       Andrew@DeFaria.com
7 # Created:      Mon May 17 07:35:59 PDT 1999
8 # Language:     Korn Shell
9 #
10 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
11 #
12 ################################################################################
13 me=$(basename $0)
14
15 sudo=${sudo:-/app/sudo}
16
17 if [ ! -x $sudo ]; then
18   print -u2 "$me: Error: Unable to find sudo!"
19   exit 1;
20 fi
21
22 if [ $# -gt 0 ]; then
23   # Execute the commands
24   $sudo -u vobadm "$@"
25 else
26   # Become vobadm
27   $sudo -u vobadm -s
28
29   if [ -x ~/.rc/functions ]; then
30     # Source in ksh functions (needed for set_title and set_prompt)
31     . ~/.rc/functions
32     # Reset title and prompt (if you can)
33     alias ct=/usr/atria/bin/cleartool
34     set_title
35     set_prompt
36   fi
37 fi