Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
170 lines (150 sloc) 6.7 KB
#
# FILE DISCONTINUED HERE
# UPDATED VERSION AT
# https://gitlab.com/yeupou/stalag13/raw/master/debian/postinst
#
# | |
# \_V_//
# \/=|=\/
# [=v=]
# __\___/_____
# /..[ _____ ]
# /_ [ [ M /] ]
# /../.[ [ M /@] ]
# <-->[_[ [M /@/] ]
# /../ [.[ [ /@/ ] ]
# _________________]\ /__/ [_[ [/@/ C] ]
# <_________________>>0---] [=\ \@/ C / /
# ___ ___ ]/000o /__\ \ C / /
# \ / /....\ \_/ /
# ....\||/.... [___/=\___/
# . . . . [...] [...]
# . .. . [___/ \___]
# . 0 .. 0 . <---> <--->
# /\/\. . . ./\/\ [..] [..]
#
#!/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_2015 = ("/etc/cron.weekly/stalag13-apt", "/etc/apt/sources.list.d/stalag13.list", "/etc/init.d/transientlog", "/etc/bashrc.d/stalag13-60-pdf2scan.sh", "/etc/init.d/shush-toramdisk", "/etc/default/shush-toramdisk", "/etc/cron.d/websys", "/etc/cron.daily/shush-toramdisk", "/etc/nginx/certs/makecert-davdroid.old.sh", "/etc/nginx/certs/makecert.old.sh", "/etc/nginx/certs/makecert-sha2.sh");
my @outdated = (@outdated_nov2003, @outdated_dec2003, @outdated_2004, @outdated_dec2004, @outdated_2005, @outdated_2006, @outdated_2007, @outdated_2010, @outdated_2011, @outdated_2012, @outdated_2014, @outdated_2015);
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"));