#!/usr/bin/perl
#Get rid of crap script
#By solemnwarning
$remove_list_e = (-e "/root/.remove_script") ? "exists" : "absent";
if($remove_list_e eq "absent") {
print "Removing Gnome, please wait........\n";
system("/usr/bin/apt-get --purge remove gnome");
print "Removing KDE, please wait........\n";
system("/usr/bin/apt-get --purge remove kde");
print "Removing X, please wait........\n";
system("/usr/bin/apt-get --purge remove x-window-system");
open(TXT, ">/root/.remove_script");
print TXT "Done x, gnome, kde";
close(TXT);
}
$custom_list_e = (-e "/root/remove.txt") ? "exists" : "absent";
if($custom_list_e eq "exists") {
print "Found a custom remove script, removing packages on list\n";
open(TXT, " @remove = ;
close(TXT);
foreach $line(@remove) {
print "Removing $line, please wait........\n";
system("/usr/bin/apt-get --purge remove $line");
}
print "Finished removing packages on list, deleting list........\n";
system("/bin/rm -f /root/remove.txt");
}else{
print "No custom remove script found, skipping custom script\n";
}
print "Done!\n";
i had same problem on my router so i made a perl script for it
make a list of the packages u want removed and save it as /root/remove.txt put 1 package per line, eg:
gimp
xchat
mozilla-firefox
ect
dont put x-window-system, gnome or kde on list, these will automaticly be removed