#!/bin/bash ### # Database fix script # Copyright (C) Thomas "ShALLaX" Pedley (gentoox@shallax.com) # # 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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ### clear echo "Magic now uses a database instead of throwing random files into" echo "/etc/conf.d/. The database is kept in /etc/conf.d/magic-database" echo "DO NOT EDIT THIS FILE OR YOU COULD TOTALLY BREAK MAGIC." echo -e "" echo "Each time you run magic, the database will be backedup to" echo "'/etc/conf.d/magic.backup/' and timestamped, should anything go wrong" echo "with your database, simply copy an old version back." sleep 20 echo "" echo "Initialising database..." sleep 2 echo -e "" echo "DO NOT EDIT THIS FILE" >> /etc/conf.d/magic-database if [ -f /etc/conf.d/fstabbed ]; then rm -rf /etc/conf.d/fstabbed fi if [ -f /etc/conf.d/newfsed ]; then echo newfs1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/newfsed fi if [ -f /etc/conf.d/f-drived ]; then echo f-drive1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/f-drived fi if [ -f /etc/conf.d/f-drived2 ]; then echo f-drive2 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/f-drived2 fi if [ -f /etc/conf.d/onxfce ]; then echo onxfce1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/onxfce fi if [ -f /etc/conf.d/useraddedd ]; then echo useradded1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/useraddedd fi if [ -f /etc/conf.d/onxvkbd ]; then echo onxvkbd1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/onxvkbd fi if [ -f /etc/conf.d/noxvkbd ]; then echo noxvkbd1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/noxvkbd fi if [ -f /etc/conf.d/iped ]; then echo ip1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/iped fi if [ -f /etc/conf.d/xbved ]; then rm -rf /etc/conf.d/xbved fi if [ -f /etc/conf.d/xbved2 ]; then echo xbv1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/xbved2 fi if [ -f /etc/conf.d/gpmed ]; then echo gpm1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/gpmed fi if [ -f /etc/conf.d/rained ]; then rm -rf /etc/conf.d/rained fi if [ -f /etc/conf.d/fatxed ]; then echo fatx1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/fatxed fi if [ -f /etc/conf.d/xfreed ]; then echo xfree1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/xfreed fi if [ -f /etc/conf.d/xvkbded ]; then echo xvkbdpatch1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/xvkbded fi if [ -f /etc/conf.d/dvded ]; then echo dvd1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/dvded fi if [ -f /etc/conf.d/peepered ]; then echo peeper1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/peepered fi if [ -f /etc/conf.d/blinked ]; then echo blink1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/blinked fi if [ -f /etc/conf.d/alsad ]; then rm -rf /etc/conf.d/alsad fi if [ -f /etc/conf.d/xfce4d ]; then echo xfcepatch1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/xfce4d fi if [ -f /etc/conf.d/displaytoolsd ]; then # echo displaytools1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/displaytoolsd fi if [ -f /etc/conf.d/rained2 ]; then echo raincoat1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/rained2 fi if [ -f /etc/conf.d/mkfatxed ]; then echo mkfatx1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/mkfatxed fi if [ -f /etc/conf.d/sudoed ]; then echo sudo1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/sudoed fi if [ -f /etc/conf.d/neweth0ed ]; then echo neweth1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/neweth0ed fi if [ -f /etc/conf.d/monitorsd ]; then rm -rf /etc/conf.d/monitorsd fi if [ -f /etc/conf.d/ejectd ]; then echo eject1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/ejectd fi if [ -f /etc/conf.d/alsad2 ]; then echo alsa2 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/alsad2 fi if [ -f /etc/conf.d/kerneled22-2 ]; then echo kernel22-2 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/kerneled22-2 fi if [ -f /etc/conf.d/kerneldownloaded22-2 ]; then echo kerneldownloaded22-2 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/kerneldownloaded22-2 fi if [ -f /etc/conf.d/joyded ]; then echo joyd1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/joyded fi if [ -f /etc/conf.d/monitors2d ]; then # echo monitors2 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/monitors2d fi if [ -f /etc/conf.d/gdmed ]; then # echo gdm1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/gdmed fi if [ -f /etc/conf.d/fstabfatxed ]; then echo fstab1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/fstabfatxed fi if [ -f /etc/conf.d/keyboardtoggled ]; then # echo keyboardtoggle1 >> /etc/conf.d/magic-database rm -rf /etc/conf.d/keyboardtoggled fi rm -rf /etc/conf.d/nvneted rm -rf /etc/conf.d/kerneldownloaded22 rm -rf /etc/conf.d/kerneldownloaded23 rm -rf /etc/conf.d/kerneldownloaded rm -rf /etc/conf.d/kerneled rm -rf /etc/conf.d/kerneled22 rm -rf /etc/conf.d/kerneled23 rm -rf /etc/conf.d/scrollwheeld rm -rf /etc/conf.d/xbvsetd rm -rf /etc/conf.d/beforekernel rm -rf /etc/conf.d/cvsed rm -rf /etc/conf.d/magicupdated mkdir /etc/conf.d/magic.backup chmod 700 /etc/conf.d/magic.backup chown root:root /etc/conf.d/magic.backup