From: <abe...@us...> - 2017-05-14 12:49:08
|
Revision: 8304 http://sourceforge.net/p/astlinux/code/8304 Author: abelbeck Date: 2017-05-14 12:49:07 +0000 (Sun, 14 May 2017) Log Message: ----------- core system, make the gen-rc-conf command more robust. While never known as a problem, previously the gen-rc-conf command updated the /etc/rc.conf file in place and theoretically /etc/rc.conf could be sourced while only partially built. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/usr/sbin/gen-rc-conf Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/gen-rc-conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/gen-rc-conf 2017-05-12 16:52:00 UTC (rev 8303) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/gen-rc-conf 2017-05-14 12:49:07 UTC (rev 8304) @@ -2,18 +2,20 @@ # Generate system rc.conf configuration script # Strip main comments and empty lines # -echo '## Auto-generated file, do not edit!!' >/tmp/etc/rc.conf +echo '## Auto-generated file, do not edit!!' >/tmp/etc/rc.conf.new if [ -d /mnt/kd/rc.conf.d ]; then if [ -f /stat/etc/rc.conf ]; then - sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf >>/tmp/etc/rc.conf + sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf >>/tmp/etc/rc.conf.new elif [ -d /stat/etc/rc.conf.d ]; then - sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf.d/*.conf >>/tmp/etc/rc.conf + sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf.d/*.conf >>/tmp/etc/rc.conf.new fi - sed -e 's/^#.*//' -e '/^$/ d' /mnt/kd/rc.conf.d/*.conf >>/tmp/etc/rc.conf + sed -e 's/^#.*//' -e '/^$/ d' /mnt/kd/rc.conf.d/*.conf >>/tmp/etc/rc.conf.new elif [ -f /mnt/kd/rc.conf ]; then - sed -e 's/^#.*//' -e '/^$/ d' /mnt/kd/rc.conf >>/tmp/etc/rc.conf + sed -e 's/^#.*//' -e '/^$/ d' /mnt/kd/rc.conf >>/tmp/etc/rc.conf.new elif [ -f /stat/etc/rc.conf ]; then - sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf >>/tmp/etc/rc.conf + sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf >>/tmp/etc/rc.conf.new elif [ -d /stat/etc/rc.conf.d ]; then - sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf.d/*.conf >>/tmp/etc/rc.conf + sed -e 's/^#.*//' -e '/^$/ d' /stat/etc/rc.conf.d/*.conf >>/tmp/etc/rc.conf.new fi + +mv /tmp/etc/rc.conf.new /tmp/etc/rc.conf This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |