Changeset 243
- Timestamp:
- 02/21/06 23:54:02 (7 years ago)
- File:
-
- 1 edited
-
install/scripts/upgrades/0.9.1.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
install/scripts/upgrades/0.9.1.sh
r241 r243 15 15 override_f=${override_d}.conf 16 16 17 pathfind() {18 OLDIFS="$IFS"19 IFS=:20 for p in $PATH; do21 if [ -x "$p/$*" ]; then22 IFS="$OLDIFS"23 return 024 fi25 done26 IFS="$OLDIFS"27 return 128 }29 30 17 # imprime le nom d'usager associé au domaine 31 18 get_account_by_domain() { 32 19 # les admintools ne sont peut-être pas là 33 if pathfind "get_account_by_domain"20 if [ -x "/usr/bin/get_account_by_domain" ] 34 21 then 35 get_account_by_domain $1 | cut -d\ -f122 /usr/bin/get_account_by_domain $1 | cut -d\ -f1 36 23 else 37 24 # implantons localement ce que nous avons besoin, puisque admintools … … 42 29 concat(if(sub="", "", concat(sub, ".")), domaine) = "'$1'";' 43 30 fi 31 } 32 33 # add the standard input to a given file, only if not already present 34 append_no_dupe() { 35 realfile=$1 36 tmpfile=`mktemp` 37 trap "rm -f $tmpfile; exit 1" 1 2 15 38 cat > $tmpfile 39 if [ -r $realfile ] && 40 diff -q $tmpfile $realfile > /dev/null || \ 41 diff -u $tmpfile $realfile | grep '^ ' | sed 's/^ //' | diff -q - $tmpfile > /dev/null 42 then 43 status=0 44 else 45 status=1 46 cat $tmpfile >> $realfile 47 fi 48 rm -f $tmpfile 49 return $status 44 50 } 45 51 … … 64 70 65 71 mkdir -p $override_d/$initial_domain 66 tmpfile=`mktemp -p $override_d/$initial_domain` 67 realfile="$override_d/$initial_domain/$domain" 68 trap "rm -f $tmpfile; exit 1" 1 2 15 69 cat - >> $tmpfile <<EOF 72 append_no_dupe "$override_d/$initial_domain/$domain" <<EOF 70 73 <Directory ${path1}> 71 74 php_admin_value open_basedir ${path2}/ 72 75 </Directory> 73 76 EOF 74 if [ -r $realfile ] &&75 diff -q $tmpfile $realfile > /dev/null || \76 diff -u $tmpfile $realfile | grep '^ ' | sed 's/^ //' | diff -q - $tmpfile > /dev/null77 then78 # no change79 else80 cat $tmpfile >> $realfile81 fi82 rm -f $tmpfile83 77 done 84 78
Note: See TracChangeset
for help on using the changeset viewer.
