#! /bin/sh #---------------------------------------------------------------------------- # template-restore-dconf - restore config file from /etc/default.d # # Copyright (c) 2001-2003 Ansgar Püster # # Creation: 24.12.2003 ap # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib header() { clrhome mecho -info "Restore configuration file from $defaultd" mecho } footer() { mecho mecho anykey } # include function library . /var/install/bin/config_shlib #---------------------------------------------------------------------------- # get package name from filename PACKAGE-restore-dconf filename=`basename $0` package=`echo $filename | sed "s|-restore-dconf$||"` # if package is template # take package from $PACKAGE [ "$package" = 'template' ] && package="$PACKAGE" #debug echo "+++ TEST filename: $filename" #debug echo " PACKAGE: $PACKAGE" #debug echo " package: $package" #debug read answ < /dev/tty header if [ ! -f $defaultd/$package ]; then mecho -error "Error: Configuration file $defaultd/$package does not exist" else mecho "Default configuration file $defaultd/$package found" mecho mecho -info "Attention: this will overwrite your current configuration" mecho -info " file for package $package with the default" mecho -info " configuation delivered with the package." mecho -info "" if /var/install/bin/ask "Continue"; then cp -p $defaultd/$package $configd/$package mecho activate_hint else mecho "Configuration file $configd/$package was not changed." fi fi footer