|
From: Heiko Z. <smi...@us...> - 2007-10-25 21:33:16
|
Update of /cvsroot/devil-linux/build/scripts/scripts In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv16650/scripts/scripts Modified Files: Tag: rel-1-2-patches upgrade-config Log Message: - upgrade-config now correctly merges new and old account and groups Index: upgrade-config =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/scripts/upgrade-config,v retrieving revision 1.22.2.9 retrieving revision 1.22.2.10 diff -u -d -r1.22.2.9 -r1.22.2.10 --- upgrade-config 6 Jul 2006 19:58:50 -0000 1.22.2.9 +++ upgrade-config 25 Oct 2007 21:33:13 -0000 1.22.2.10 @@ -255,6 +255,8 @@ if askyesno "User and Group migration" "Do you want to migrate your old users, groups and passwords?" yes ; then migrateid () { + cp -f newconfig/${1} newconfig/${1}.dl + cp -f newconfig/${2} newconfig/${2}.dl cp -f ${1} newconfig/${1} cp -f ${2} newconfig/${2} cp -f ${1} newconfig/${1}- @@ -262,12 +264,14 @@ # Add all non-existing users/groups to new config while read id ; do - name="$(echo $id|cut -d: -f1)" - [ "$(grep -c "^${name}:" newconfig/${1})" -gt 0 ] && continue - grep "^${name}:" ${1} >> newconfig/${1} - grep "^${name}:" ${2} >> newconfig/${2} - echo ${name} - created. | tee -a $LOGF - done < $1 + name="$(echo $id|cut -d: -f1)" + [ "$(grep -c "^${name}:" newconfig/${1})" -gt 0 ] && continue + grep "^${name}:" newconfig/${1}.dl >> newconfig/${1} + grep "^${name}:" newconfig/${2}.dl >> newconfig/${2} + echo ${name} - created. | tee -a $LOGF + done < newconfig/${1}.dl + rm -f newconfig/${1}.dl + rm -f newconfig/${2}.dl } echo >> $LOGF |