#!/bin/sh
#----------------------------------------------------------------------------
# /var/install/bin/del_advancedconfigmenu
#                        configure Advanced configuration file handling
#
# Creation:     2003-12-23  ap
# Last Update:  $Id$
#
# Copyright (c) 2001-2003 Ansgar Püster, Ansgar.Puester(at)T-Online.de
# Copyright (c) 2003-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org
#
# 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


# with update 1.1.0 this function is deprecated
mecho --warn " Use of 'del_advancedconfigmenu' is deprecated"
echo
anykey


if [ "$1" = "-quiet" ]
then
    quietflag='quiet'
    shift
fi

if [ $# -lt 1 ]; then
   mecho "Usage: $0 -quiet PACKAGE"
   exit 1
fi

package=$1
fname=`basename $0`

if [ "$package" = 'master' -o "$package" = 'template' ]; then
   mecho -error "Package name $package is a reserved name."
   mecho -error "You can't use this name when using $fname."
   mecho -error "Script aborted"
   exit 1
fi

if [ "$quietflag" != "quiet" ]
then
    mecho "Removing files for 'Advanced configuration handling' for package $package"
    mecho "Removing menu file ..."
fi

rm -f /var/install/menu/setup.services.$package.advancedconfig.menu

if [ "$quietflag" != "quiet" ]
then
    mecho "Done."
    mecho "Removing links in /var/install/bin"
fi

for FNAME in -advancedconfig -backup-config -restore-dconf -restore-bconf -diff-cd -diff-cb -diff-db -diff-bb
do
    rm -f /var/install/bin/${package}$FNAME
done

if [ "$quietflag" != "quiet" ]
then
    mecho "Done."
    mecho
    mecho "Remove the following line from the menu file of package $package"
    mecho -info "/var/install/bin/${package}-advancedconfig Advanced configuration file handling"
fi