Ignore:
Timestamp:
Jan 13, 2010, 12:08:55 AM (14 years ago)
Author:
ezyang
Message:
Push Wizard code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/locker/deploy/bin/onathena

    r1217 r1417  
    1515  exit 1
    1616}
    17  
     17
     18attach scripts
    1819
    1920sshrun() {
    20   athrun scripts scripts-ssh "$lname" "/mit/scripts/$@" 2>/dev/null
     21  /afs/athena.mit.edu/contrib/scripts/bin$scriptsdev/scripts-ssh "$lname" "/mit/scripts/$@" 2>/dev/null
    2122}
    2223
    2324vsshrun() {
    24   athrun scripts scripts-ssh "$lname" "/mit/scripts/$@"
     25  /afs/athena.mit.edu/contrib/scripts/bin$scriptsdev/scripts-ssh "$lname" "/mit/scripts/$@"
    2526}
    2627
     
    158159fi
    159160
    160 if [ "$prompt_username" = "" ]; then
    161   admin_username="admin"
    162   prompt_username=0
    163 fi
    164 if [ "$prompt_password" = "" ]; then
    165   prompt_password=1
    166 fi
    167 
    168 if [ "$prompt_username" -eq 1 ]; then
    169     echo
    170     echo "You will be able to log in to $sname using a username of your choice."
    171     echo "Please decide upon a username and enter it below."
    172     echo "Your username must contain only alphanumeric characters (a-z, 0-9)."
    173     printf "Desired username: "
    174     read admin_username
    175     admin_username=`perl -0e 'print $ARGV[0] =~ /^([[:alnum:]]+)$/' -- "$admin_username"`
    176     if [ "$admin_username" = "" ]; then
    177         echo
    178         echo ERROR:
    179         echo "Your username must contain only alphanumeric characters (a-z, 0-9)."
    180         echo "You will need to run the installer again and choose a different username."
    181         exit 1
    182     fi
    183 fi
    184 
    185161origdir=`pwd`
    186162mkdir -p "$lroot/web_scripts_tmp"
     
    198174fs sa . system:scripts-security-upd write
    199175
    200 if [ "$prompt_password" -eq 1 ]; then
    201     stty -echo
    202     sshrun "deploy$scriptsdev/bin/prompt-password" "$sname" "$deploy" "$addrend" "$admin_username"
    203     stty echo
    204 fi
    205 
    206 echo
    207 echo "Unpacking $sname... (this step might take several minutes)"
    208 
    209176# This version is deprecated, use create_scripts_dir instead
    210177
     
    235202fi
    236203
    237 # xavid: use p to keep the same permissions as in the file
    238 athrun scripts gtar zxpf "/mit/scripts/deploy$scriptsdev/$deploy.tar.gz"
    239 files=`athrun scripts gfind . -mindepth 1 -maxdepth 1 | grep -v .admin`
    240 numfiles=`echo "$files" | wc -l`
    241 if [ ! -z "$files" ]; then
    242     if [ "$numfiles" -eq 1 ]; then
    243         athrun scripts gfind . -mindepth 2 -maxdepth 2 | xargs -i mv \{} .
    244         rmdir "$files"
     204if [ "$wizard" != "" ]; then
     205  vsshrun "wizard/bin/wizard" "install" "$@" "$wizard" "$lroot/web_scripts/$addrend"
     206  exit 0
     207fi
     208
     209if [ "$prompt_username" = "" ]; then
     210  admin_username="admin"
     211  prompt_username=0
     212fi
     213if [ "$prompt_password" = "" ]; then
     214  prompt_password=1
     215fi
     216
     217if [ "$prompt_username" -eq 1 ]; then
     218    echo
     219    echo "You will be able to log in to $sname using a username of your choice."
     220    echo "Please decide upon a username and enter it below."
     221    echo "Your username must contain only alphanumeric characters (a-z, 0-9)."
     222    printf "Desired username: "
     223    read admin_username
     224    admin_username=`perl -0e 'print $ARGV[0] =~ /^([[:alnum:]]+)$/' -- "$admin_username"`
     225    if [ "$admin_username" = "" ]; then
     226        echo
     227        echo ERROR:
     228        echo "Your username must contain only alphanumeric characters (a-z, 0-9)."
     229        echo "You will need to run the installer again and choose a different username."
     230        exit 1
    245231    fi
    246232fi
    247 if [ -f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" ]; then
    248         nodot=`echo "$lname" | sed "/\./s///"`;
    249         sed -e "/SCRIPTS_USER/ s//$lname/" -e "/SCRIPTS_NODOT/ s//$nodot/" "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" > php.ini
    250         athrun scripts gfind . -mindepth 1 -type d -exec sh -c 'ln -sf "`echo "$1" | sed '\''s,[^/],,g; s,/,../,g'\''`php.ini" "$1/"' -- {} \;
    251 fi
     233
     234if [ "$prompt_password" -eq 1 ]; then
     235    stty -echo
     236    sshrun "deploy$scriptsdev/bin/prompt-password" "$sname" "$deploy" "$addrend" "$admin_username"
     237    stty echo
     238fi
     239
    252240cd "$origdir"
    253241
    254 vsshrun "deploy$scriptsdev/bin/$deploy" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
     242echo
     243echo "Unpacking $sname... (this step might take several minutes)"
     244
     245vsshrun "deploy$scriptsdev/bin/$deploy" "$lname" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
    255246rm -f "$lroot/web_scripts/$addrend/.scripts-tmp"
    256247checkfailed
Note: See TracChangeset for help on using the changeset viewer.