wok-4.x rev 1098

slitaz-tools: backup/restore config files (avoid reconfig for HD install)
author Christophe Lincoln <pankso@slitaz.org>
date Thu Jul 17 23:28:01 2008 +0200 (2008-07-17)
parents 003320640bc6
children c00f0c80d4f8
files slitaz-tools/receipt
line diff
     1.1 --- a/slitaz-tools/receipt	Thu Jul 17 17:02:06 2008 +0000
     1.2 +++ b/slitaz-tools/receipt	Thu Jul 17 23:28:01 2008 +0200
     1.3 @@ -80,6 +80,21 @@
     1.4  	chmod -R 755 $fs/sbin
     1.5  }
     1.6  
     1.7 +# Pre install commands.
     1.8 +pre_install()
     1.9 +{
    1.10 + 	local root
    1.11 + 	root=$1
    1.12 +	# Backup file to restore with post install
    1.13 +	echo "Creating backups of configs..."
    1.14 +	cp $root/etc/TZ $root/etc/TZ.bak 2>/dev/null
    1.15 +	cp $root/etc/keymap.conf $root/etc/keymap.conf.bak 2>/dev/null
    1.16 +	cp $root/etc/X11/screen.conf $root/etc/X11/screen.conf.bak 2>/dev/null
    1.17 +	cp $root/etc/locale.conf $root/etc/locale.conf.bak 2>/dev/null
    1.18 +	cp $root/etc/firewall.conf $root/etc/firewall.conf.bak 2>/dev/null
    1.19 +}
    1.20 +
    1.21 +# Post install
    1.22  post_install()
    1.23  {
    1.24  	( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
    1.25 @@ -91,6 +106,12 @@
    1.26  etc/locale.conf
    1.27  etc/firewall.conf
    1.28  EOT
    1.29 +	echo "Restoring configs backups..."
    1.30 +	mv -f $root/etc/TZ.bak $root/etc/TZ 2>/dev/null
    1.31 +	mv -f $root/etc/keymap.conf.bak $root/etc/keymap.conf 2>/dev/null
    1.32 +	mv -f $root/etc/X11/screen.conf.bak $root/etc/X11/screen.conf 2>/dev/null
    1.33 +	mv -f $root/etc/locale.conf.bak $root/etc/locale.conf 2>/dev/null
    1.34 +	mv -f $root/etc/firewall.conf.bak $root/etc/firewall.conf 2>/dev/null
    1.35  }
    1.36  
    1.37  repack_cleanup()