- Timestamp:
- Oct 13, 2007, 8:59:12 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
locker/deploy/bin/onathena
r456 r457 3 3 checkfailed() { 4 4 if [ -f "$lroot/web_scripts/$addrend/.failed" ]; then 5 rm -f $lroot/web_scripts/$addrend/.failed5 rm -f "$lroot/web_scripts/$addrend/.failed" 6 6 exit 1 7 7 fi … … 26 26 27 27 checksqlpass() { 28 errors=`sshrun 'sql/bin$scriptsdev/test-password'`28 errors=`sshrun "sql/bin$scriptsdev/test-password"` 29 29 if [ "$errors" != "" ]; then 30 30 if [ "$1" -eq 1 ]; then 31 rm -f $lroot/.sql/my.cnf31 rm -f "$lroot/.sql/my.cnf" 32 32 fi 33 33 echo … … 48 48 49 49 echo 50 echo == Welcome to the scripts.mit.edu installer for $sname ==50 echo "== Welcome to the scripts.mit.edu installer for $sname ==" 51 51 echo 52 52 … … 54 54 echo "see <http://scripts.mit.edu/start>." 55 55 echo 56 echo Please report problems with this installer to scripts@mit.edu.57 echo 58 echo Are you performing this install for:59 echo 1. Your personal Athena account60 echo 2. A locker that you control \(a club, a course, etc\)61 echo If you do not understand this question, you should answer \'1\'.56 echo "Please report problems with this installer to scripts@mit.edu." 57 echo 58 echo "Are you performing this install for:" 59 echo "1. Your personal Athena account" 60 echo "2. A locker that you control (a club, a course, etc)" 61 echo "If you do not understand this question, you should answer '1'." 62 62 printf "Please enter either '1' or '2' (without quotes): " 63 63 read whofor 64 if [ "$whofor" -eq1 ]; then64 if [ "$whofor" = 1 ]; then 65 65 lname=$USER 66 66 lroot=$HOME 67 elif [ "$whofor" -eq2 ]; then68 echo 69 echo OK. $sname will be installed into a locker of your choice that70 echo you control. Please enter the name of the selected locker below.67 elif [ "$whofor" = 2 ]; then 68 echo 69 echo "OK. $sname will be installed into a locker of your choice that" 70 echo "you control. Please enter the name of the selected locker below." 71 71 echo "(For the locker /mit/lsc -- which has a full path of" 72 72 echo "/afs/athena.mit.edu/activity/l/lsc -- you would simply enter lsc)." … … 76 76 else 77 77 echo 78 echo ERROR:79 echo You must select either '1' or '2'.78 echo "ERROR:" 79 echo "You must select either '1' or '2'." 80 80 exit 1 81 81 fi … … 85 85 86 86 attach scripts 2>/dev/null 87 . /mit/scripts/bin$scriptsdev/signup-web88 89 echo 90 echo Your new copy of $sname will appear on the web at a URL91 echo that starts with http://scripts.mit.edu/~$lname/92 echo Please decide upon a complete URL and enter it below.93 echo You must enter one or more characters after ~$lname/94 echo The completed address must only contain a-z, 0-9, and /.87 . "/mit/scripts/bin$scriptsdev/signup-web" 88 89 echo 90 echo "Your new copy of $sname will appear on the web at a URL" 91 echo "that starts with http://scripts.mit.edu/~$lname/" 92 echo "Please decide upon a complete URL and enter it below." 93 echo "You must enter one or more characters after ~$lname/" 94 echo "The completed address must only contain a-z, 0-9, and /." 95 95 printf "Desired address: http://scripts.mit.edu/~$lname/" 96 96 read addrend 97 97 98 addrend=`perl - e "\\\$temp = \"$addrend\"; \\\$temp .= \"/\" unless \\\$temp =~ /\\\\/$/; \\\$temp =~ /(^([a-z0-9A-Z\\\\/-]+)\$)/; print \\\$1"`98 addrend=`perl -0e 'print $ARGV[0] =~ /^([\w\/-]*[\w-])\/*$/' -- "$addrend"` 99 99 if [ "$addrend" = "" ]; then 100 100 echo 101 echo ERROR:102 echo You must enter one or more characters after ~$lname/103 echo The completed address must only contain a-z, 0-9, and /.101 echo "ERROR:" 102 echo "You must enter one or more characters after ~$lname/" 103 echo "The completed address must only contain a-z, 0-9, and /." 104 104 exit 1 105 105 fi … … 107 107 if [ -d "$lroot/web_scripts/$addrend" ]; then 108 108 echo 109 echo ERROR:110 echo You already have a directory corresponding to that web address.111 echo Please remove that directory, choose a different address, or112 echo contact scripts@mit.edu for assistance.109 echo "ERROR:" 110 echo "You already have a directory corresponding to that web address." 111 echo "Please remove that directory, choose a different address, or" 112 echo "contact scripts@mit.edu for assistance." 113 113 exit 1 114 114 fi … … 119 119 120 120 if [ ! -f "$lroot/.my.cnf" ]; then 121 mkdir $lroot/.sql2>/dev/null122 fs sa $lroot/.sqldaemon.scripts write123 fs sa $lroot/.sqldaemon.sql write124 ln -nfs $lroot/.sql/my.cnf $lroot/.my.cnf2>/dev/null125 fi 126 127 fs sa $lroot/.sqlsystem:anyuser none128 fs sa $lroot/.sqlsystem:authuser none121 mkdir "$lroot/.sql" 2>/dev/null 122 fs sa "$lroot/.sql" daemon.scripts write 123 fs sa "$lroot/.sql" daemon.sql write 124 ln -nfs "$lroot/.sql/my.cnf" "$lroot/.my.cnf" 2>/dev/null 125 fi 126 127 fs sa "$lroot/.sql" system:anyuser none 128 fs sa "$lroot/.sql" system:authuser none 129 129 130 130 if [ "$requires_sql" -eq 1 ]; then … … 132 132 if [ "$sqlinfo" = "" ]; then 133 133 echo 134 echo You already have a MySQL account but you do not have a .my.cnf file.135 echo If you do not remember your MySQL account password, you can change it136 echo at http://sql.mit.edu using MIT certificates.134 echo "You already have a MySQL account but you do not have a .my.cnf file." 135 echo "If you do not remember your MySQL account password, you can change it" 136 echo "at http://sql.mit.edu using MIT certificates." 137 137 printf "Please type your MySQL password and press [enter]: " 138 138 stty -echo … … 142 142 sqlhost="sql.mit.edu" 143 143 sqluser=$lname 144 . /mit/scripts/sql/bin$scriptsdev/save-password144 . "/mit/scripts/sql/bin$scriptsdev/save-password" 145 145 checksqlpass 1 'The MySQL password that you typed appears to be incorrect.\n' '' 146 146 echo 147 echo OK. Continuing with the install...147 echo "OK. Continuing with the install..." 148 148 else 149 149 checksqlpass 0 'The MySQL login information in your .my.cnf file\n' 'appears to be incorrect.\n' … … 161 161 if [ "$prompt_username" -eq 1 ]; then 162 162 echo 163 echo You will be able to log in to $sname using a username of your choice.164 echo Please decide upon a username and enter it below.163 echo "You will be able to log in to $sname using a username of your choice." 164 echo "Please decide upon a username and enter it below." 165 165 echo "Your username must contain only alphanumeric characters (a-z, 0-9)." 166 166 printf "Desired username: " 167 167 read admin_username 168 admin_username=`perl - e "\\\$temp = \"$admin_username\"; \\\$temp =~ /(^([a-z0-9A-Z]+)\\\$)/; print \\\$1;"`168 admin_username=`perl -0e 'print $ARGV[0] =~ /^([[:alnum:]]+)$/' -- "$admin_username"` 169 169 if [ "$admin_username" = "" ]; then 170 170 echo 171 171 echo ERROR: 172 172 echo "Your username must contain only alphanumeric characters (a-z, 0-9)." 173 echo You will need to run the installer again and choose a different username.173 echo "You will need to run the installer again and choose a different username." 174 174 exit 1 175 175 fi … … 192 192 if [ "$prompt_password" -eq 1 ]; then 193 193 stty -echo 194 sshrun "deploy$scriptsdev/bin/prompt-password '$sname' '$deploy' '$addrend' '$admin_username'"194 sshrun "deploy$scriptsdev/bin/prompt-password" "$sname" "$deploy" "$addrend" "$admin_username" 195 195 stty echo 196 196 fi … … 216 216 if [ "$numfiles" -eq 1 ]; then 217 217 athrun scripts gfind . -mindepth 2 -maxdepth 2 | xargs -i mv \{} . 218 rmdir $files218 rmdir "$files" 219 219 fi 220 220 if [ -f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" ]; then 221 nodot=`echo $lname| sed "/\./s///"`;222 sed -e /SCRIPTS_USER/s//$lname/ -e /SCRIPTS_NODOT/s//$nodot/ /mit/scripts/deploy$scriptsdev/php.ini/$deploy> php.ini221 nodot=`echo "$lname" | sed "/\./s///"`; 222 sed -e "/SCRIPTS_USER/ s//$lname/" -e "/SCRIPTS_NODOT/ s//$nodot/" "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" > php.ini 223 223 athrun scripts gfind . -mindepth 1 -type d -exec sh -c 'ln -sf "`echo "$1" | sed '\''s,[^/],,g; s,/,../,g'\''`php.ini" "$1/"' -- {} \; 224 224 fi 225 cd $origdir226 227 vsshrun "deploy$scriptsdev/bin/$deploy '$sname' '$deploy' '$addrend' '$admin_username' '$requires_sql' '$scriptsdev' '$USER'" || die "Unknown failure during configuration"228 rm -f /$lroot/web_scripts/$addrend/.scripts-tmp225 cd "$origdir" 226 227 vsshrun "deploy$scriptsdev/bin/$deploy" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration" 228 rm -f "$lroot/web_scripts/$addrend/.scripts-tmp" 229 229 checkfailed 230 230 231 231 echo 232 echo == Installation complete! ==233 echo You should now be able to access your new copy of $sname at234 echo http://scripts.mit.edu/~$lname/$addrend232 echo "== Installation complete! ==" 233 echo "You should now be able to access your new copy of $sname at" 234 echo "http://scripts.mit.edu/~$lname/$addrend/" 235 235 echo "(You can replace the http with https if you want to use encryption)" 236 echo If you have trouble accessing it, feel free to contact237 echo the scripts.mit.edu team by e-mailing scripts@mit.edu236 echo "If you have trouble accessing it, feel free to contact" 237 echo "the scripts.mit.edu team by e-mailing scripts@mit.edu" 238 238 exit 0
Note: See TracChangeset
for help on using the changeset viewer.