Update of /cvsroot/devil-linux/build/scripts/scripts
In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv16294/scripts/scripts
Modified Files:
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.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- upgrade-config 12 Jun 2006 02:59:21 -0000 1.27
+++ upgrade-config 25 Oct 2007 21:32:57 -0000 1.28
@@ -123,7 +123,7 @@
# comparesubstr "$f" "etc/ssh/ssh_host_" && onoff="on"
comparesubstr "$f" "etc/init.d/" && onoff="off"
comparesubstr "$f" "etc/init.d/firewall.rules" && onoff="on"
- comparesubstr "$f" "etc/init.d/boot.local" && onoff="on"
+# comparesubstr "$f" "etc/init.d/boot.local" && onoff="on"
finfo=$(ls -a $f)
cmp -s $f newconfig/$f || echo $f \"\" $onoff \"$finfo\" >> $TMPD
done
@@ -223,7 +223,7 @@
echo "preserving link: $f" | tee -a $LOGF
cp -dpf $f newconfig/$f
done
-
+ pause
break
fi
else
@@ -249,11 +249,14 @@
do
eval mod_config newconfig/etc/sysconfig/config ${bs} \"\$${bs}\"
done
+ pause
fi
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}-
@@ -261,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
@@ -299,17 +304,10 @@
mv -f newconfig/etc/inittab.new newconfig/etc/inittab
# syslog-ng
-# make sure, that all chroot jail entries are removed
-for I in $(ls newconfig/etc/sysconfig/jail)
-do
- A=${I##/*/}
- sed -e "s| unix-stream(\"$JAIL_DIR/$A/dev/log\" max-connections(1000));||" < newconfig/etc/syslog-ng/syslog-ng.conf > $TMPD
- mv $TMPD newconfig/etc/syslog-ng/syslog-ng.conf
-done
-
-# syslog-ng
-# replace stream with dgram
-sed -e "s|unix-stream(\"/dev/log\"|unix-dgram(\"/dev/log\"|" < newconfig/etc/syslog-ng/syslog-ng.conf > $TMPD
+# remove all chroot jail entries and replace stream with dgram
+sed -e 's|unix-stream *( *"/jail[^;]*;||g' \
+ -e 's|unix-stream *( *"/dev/log"|unix-dgram("/dev/log"|' \
+ < newconfig/etc/syslog-ng/syslog-ng.conf > $TMPD
mv $TMPD newconfig/etc/syslog-ng/syslog-ng.conf
rm -fr $TMPD $RESULT
|