Removed /usr/local from CDPATH
[clearscm.git] / clients / HP / bin / root
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         root
5 # Description:  A script to go into "wizard" mode
6 # Author:       Andrew@DeFaria.com
7 # Created:      Mon May 17 07:35:59 PDT 1999
8 # Language:     Bash shell
9 #
10 # (c) Copyright 1999, Andrew DeFaria, all rights reserved.
11 #
12 ################################################################################
13 me=$(basename $0)
14
15 # Set adm_base
16 adm_base=${adm_base:-$HOME/adm}
17
18 # Set adm_fpath
19 adm_fpath=${adm_fpath:-$adm_base/functions}
20
21 # Source functions
22 . $adm_fpath/common
23
24 if [ ! -x $(type -p sudo) ]; then
25   warning "$me: Warning: Unable to find sudo!"
26   exit 1
27 fi
28
29 if [ $# -gt 0 ]; then
30   # Execute the commands
31   sudo $@ 
32 else
33   # Become a "wizard"!
34   sudo -s
35
36   if [ -x ~/.rc/functions ]; then
37     # Source in ksh functions (needed for set_title and set_prompt)
38     . ~/.rc/functions
39     # Reset title and prompt (if you can)
40     set_title
41     set_prompt
42   fi
43 fi