Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 142 lines (124 sloc) 5.468 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
#!/usr/bin/perl

# remove outdated stuff
my @outdated_nov2003 = ("/etc/cron.daily/backuparea",
"/etc/cron.daily/autoapt",
"/etc/cron.daily/emacsstart",
"/etc/cron.daily/eximstats",
"/etc/cron.daily/indexer",
"/etc/cron.daily/majfichiersenligne",
"/etc/cron.daily/mrclean",
"/etc/cron.daily/rcs2log",
"/etc/cron.daily/sharing",
"/etc/cron.daily/majfichiersenligne",
"/etc/cron.d/fetchmailupdate",
"/etc/cron.d/xplanet",
"/etc/cron.d/apt-ftparchive",
"/etc/cron.weekly/apt-ftparchive",
"/etc/cron.weekly/autoapt",
"/etc/cron.weekly/cours",
"/etc/cron.weekly/mail-archives",
"/etc/cron.weekly/backups",
"/etc/cron.hourly/checkout",
"/etc/cron.hourly/fetchmail_restart",
"/etc/cron.hourly/mail-achives",
"/etc/cron.hourly/poids",
"/etc/cron.hourly/sharing",
"/etc/cron.hourly/www-cache");

my @outdated_dec2003 = ("/etc/cron.hourly/cgnserv_wwwcache",
"/etc/cron.hourly/mail-archives",
"/etc/cron.hourly/sharing.deb",
"/etc/profile.d/ssh.sh",
"/etc/profile.d/aterm.sh",
"/etc/profile.d/gdict.sh");

my @outdated_2004 = ("/etc/cron.d/cgn_xplanet",
"/etc/cron.daily/cgn_sharing",
"/etc/profile.d/rsync.sh",
"/etc/cron.weekly/cgnserv_backups_maketarball");


my @outdated_dec2004 = ("/etc/dhcp3/dhclient-enter-hooks.d/cgn-sendaddress.sh",
"/etc/cron.daily/cgn_autoapt");

my @outdated_2005 = ("/etc/cron.weekly/cgn_sharing",
"/etc/cron.d/cgnserv_aptarchive_updateinfo",
"/etc/cron.hourly/cgnserv_aptarchives_update",
"/etc/AT-server.bouquins2kwiki");

my @outdated_2006 = ("/etc/cron.weekly/cgnserv_son_makeplaylists.pl",
"/etc/apache/conf.d/newicons.conf",
"/etc/cron.daily/cgnserv_wwwcache",
"/etc/cron.daily/AT-server.bouquins2kwiki",
"/etc/cron.daily/AT-server.sons-makeplaylists.pl",
"/etc/cron.d/AT-clients.update-bookmarks",
"/etc/cron.d/AT-server.apt-archives-update",
"/etc/cron.d/cgnserv_dilbertget");

my @outdated_2007 = ("/etc/cron.daily/cgn_eximstats",
"/etc/cron.daily/AT-sons-makeplaylists.pl");

my @outdated_2010 = ("/etc/emacs/site-start.d/stalag13.el",
"/etc/cron.daily/AT-sons-makeplaylists.pl",
"/etc/profile.d/tar.sh",
"/etc/profile.d/ls.sh",
"/etc/profile.d/aptall.sh",
"/etc/profile.d/shell.sh",
"/etc/init.d/rtorrent");

my @outdated_2011 = ("/etc/init.d/torrent",
"/etc/dhcp/dhclient-enter-hooks.d/nfs",
"/etc/dhcp/dhclient-exit-hooks.d/nfs",
"/etc/profile.d/stalag13-aptall.sh",
"/etc/network/if-down.d/prepandumountnfs");

my @outdated_2012 = ("/etc/init.d/fcgi",
"/etc/cron.daily/stalag13-ntpdate",
"/etc/cron.daily/torrent",
"/etc/profile.d/stalag13-ls.sh",
"/etc/profile.d/stalag13-tar.sh",
"/etc/apt/apt.conf.d/99debfoster",
"/etc/profile.d/stalag13-shell.sh",
"/etc/profile.d/stalag13-torrent.sh",
"/etc/profile.d/stalag13-shortcuts.sh",
"/etc/profile.d/01-stalag13-bashrc.sh",
"/etc/exim4/conf.d/acl/25_stalag13-greylist",
"/etc/exim4/conf.d/acl/21_stalag13_system_aliases_ban",
"/etc/exim4/conf.d/rewrite/15_rewritestalag",
"/etc/exim4/conf.d/transport/35_spamblock",
"/etc/exim4/conf.d/router/450_spamblock",
"/etc/exim4/conf.d/acl/01_spamblock",
"/etc/init.d/dovecotfix");

my @outdated_2014 = ("/etc/bashrc.d/stalag13-shell.sh",
"/etc/bashrc.d/stalag13-shortcuts.sh",
"/etc/bashrc.d/stalag13-torrent.sh",
"/etc/apt/sources.list.sample",
"/etc/apt/sources.list.d/attique.org.list",
"/etc/exim4/conf.d/main/30_stalag13_spamblock",
"/etc/exim4/conf.d/main/30_stalag13_greylist",
"/etc/exim4/conf.d/transport/35_stalag13_spamblock",
"/etc/exim4/conf.d/acl/01_stalag13_spamblock",
"/etc/exim4/conf.d/acl/25_stalag13_greylist",
"/etc/exim4/conf.d/router/450_stalag13-spamblock",
"/etc/exim4/conf.d/router/350_stalag13-system_aliases_banned",
"/etc/exim4/conf.d/router/395_stalag13-shopping_catchall",
"/etc/exim4/conf.d/router/399_stalag13-system_aliases_per_domain",
"/etc/cron.daily/steam");

my @outdated = (@outdated_nov2003, @outdated_dec2003, @outdated_2004, @outdated_dec2004, @outdated_2005, @outdated_2006, @outdated_2007, @outdated_2010, @outdated_2011, @outdated_2012, @outdated_2014);

foreach my $file (@outdated) {
    unlink($file) && print "$file removed\n" if -e $file;
}

# make sure we have do run /etc/bashrc.d because not (yet?) debian standard
# do nothing if the string "in /etc/bashrc.d/*.sh" exists.
my $need_to_add_bashrcd = 1;
open(BASHRC, "< /etc/bash.bashrc");
while(<BASHRC>) {
    $need_to_add_bashrcd = 0
if m/in\s\/etc\/bashrc\.d\/\*\.sh/;
# print "string in \/etc\/bashrc\.d\/\*\.sh found in /etc/bash.bashrc, no update required.\n" unless
# $need_to_add_bashrcd;
}
close(BASHRC);
if ($need_to_add_bashrcd) {
    open(BASHRC, ">> /etc/bash.bashrc");
    print BASHRC "\n".'[ -z "$ETC_BASHRC_SOURCED" ] && for i in /etc/bashrc.d/*.sh ; do if [ -r "$i" ]; then . $i; fi; done'."\n";
    print "/etc/bashrc.d/ now handled by /etc/bash.bashrc\n";
    close(BASHRC);
}


# make sure some arbitrary symlinks exists
system("ln", "-sv",
       "/etc/profile.d/bash_completion.sh",
       "/etc/bashrc.d/bash_completion.sh")
    if ((-e "/etc/profile.d/bash_completion.sh") &&
(-e "/etc/bashrc.d") &&
(! -e "/etc/bashrc.d/bash_completion.sh"));
Something went wrong with that request. Please try again.