wok-current rev 2053
slim: backup config if exist (mainly keep screen config when upgrade)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Jan 17 23:08:54 2009 +0100 (2009-01-17) |
parents | a7f633ead756 |
children | fc784f29b3f6 |
files | slim/receipt |
line diff
1.1 --- a/slim/receipt Sat Jan 17 20:50:01 2009 +0100 1.2 +++ b/slim/receipt Sat Jan 17 23:08:54 2009 +0100 1.3 @@ -33,8 +33,24 @@ 1.4 chown -R root.root $fs 1.5 } 1.6 1.7 +pre_instal() 1.8 +{ 1.9 + local root 1.10 + root=$1 1.11 + # Backup config file. 1.12 + if [ -f $root/etc/slim.conf ]; then 1.13 + cp $root/etc/slim.conf $root/etc/slim.conf.bak 1.14 + fi 1.15 +} 1.16 + 1.17 post_install() 1.18 { 1.19 + local root 1.20 + root=$1 1.21 + # Restore original config. 1.22 + if [ -f $root/etc/slim.conf.bak ]; then 1.23 + mv -f $root/etc/slim.conf.bak $root/etc/slim.conf 1.24 + fi 1.25 local USER 1.26 USER=$(awk -F: '/:1000:1000:/ { print $1 }' < $1/etc/passwd) 1.27 [ -n "$USER" ] &&