Parce que «Ça peut toujours servir»™ et que de toutes façons il y en a déjà des bouts qui sont dans le dépôt et que c'est chiant de git add -f.
Et puis bon, ça fait que 3Mo
This commit is contained in:
parent
29f50c2ed9
commit
3bde363deb
299 changed files with 17466 additions and 0 deletions
11
archive/archives/E-mail_all
Executable file
11
archive/archives/E-mail_all
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
./remail $1 $2 > email.tmp
|
||||||
|
chmod a+x email.tmp
|
||||||
|
echo maintenant il faut editer ./email.tmp avec pico
|
||||||
|
echo et virrer les ^M qui apparaissent.
|
||||||
|
echo apres, on lance ./email.tmp et on l'efface
|
||||||
|
#./email.tmp
|
||||||
|
#rm email.tmp
|
||||||
|
echo Done
|
||||||
|
# envoie un E-mail a tout le monde
|
||||||
|
# orthographe : E-mail_all fichier.txt "titre"
|
7
archive/archives/MiroirConfig
Executable file
7
archive/archives/MiroirConfig
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
#Copie de sauvegarde de toute la config de zamok
|
||||||
|
#lancé par cron.daily
|
||||||
|
scp -1BCr /etc/CRANS /etc/genConfs zamok@komaz:/var/zamok
|
||||||
|
scp -1BCr /etc/CRANS /etc/genConfs zamok@sila:/var/zamok
|
||||||
|
|
8
archive/archives/MiroirFWall
Executable file
8
archive/archives/MiroirFWall
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
scp -1BCr /etc/CRANS/blacklist.cf zamok@komaz:/var/zamok/CRANS/
|
||||||
|
scp -1BCr /etc/CRANS/blacklist.cf zamok@sila:/var/zamok/CRANS/
|
||||||
|
|
||||||
|
#On n'a pas besoin de tout mirrorer à chaque lanceMake.
|
||||||
|
#scp -BCr /etc/CRANS /etc/genConfs zamok@komaz:/var/zamok
|
||||||
|
#scp -BCr /etc/CRANS /etc/genConfs zamok@sila:/var/zamok
|
||||||
|
|
2
archive/archives/SMBMessage
Executable file
2
archive/archives/SMBMessage
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
cat $3 | smbclient -U $1 -M $2
|
425
archive/archives/analyse.pl
Executable file
425
archive/archives/analyse.pl
Executable file
|
@ -0,0 +1,425 @@
|
||||||
|
#!/usr/bin/perl -w
|
||||||
|
##
|
||||||
|
## Analyse.pl
|
||||||
|
##
|
||||||
|
## Made by Vincent HANQUEZ <rv@crans.org>
|
||||||
|
##
|
||||||
|
## Started on Tue 09 Oct 2001 01:28:25 AM CEST tab
|
||||||
|
## Last Update dim 10 fév 2002 16:55:24 CET Nicolas STRANSKY
|
||||||
|
##
|
||||||
|
## 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; only version 2 of the License
|
||||||
|
##
|
||||||
|
## 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, USA.
|
||||||
|
##
|
||||||
|
##
|
||||||
|
## AUTEUR: Vincent HANQUEZ
|
||||||
|
## MAINTAINERS: Vincent HANQUEZ, Nicolas STRANSKY
|
||||||
|
##
|
||||||
|
## DESCRIPTION: analyse permet de creer des resumes des fichiers de
|
||||||
|
## log cree par net-acct. Net-acct est un daemon qui permet de logguer toutes
|
||||||
|
## les connexions effectues.
|
||||||
|
##
|
||||||
|
## SYNOPSIS: analyse [-d] [-h <host>][-m <to>][-n <nb>][-f <file>]
|
||||||
|
##
|
||||||
|
## VERSION: 0.35
|
||||||
|
##
|
||||||
|
##
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use File::stat;
|
||||||
|
use POSIX qw(strftime);
|
||||||
|
use AppConfig qw(:expand :argcount);
|
||||||
|
require Mail::Send;
|
||||||
|
|
||||||
|
my $ip_interne = "138\.231\.1(3[6-9]|4[0-3])\.";
|
||||||
|
|
||||||
|
## Do not modify after
|
||||||
|
|
||||||
|
my $VERSION = 0.35;
|
||||||
|
my $AUTEUR = "Vincent HANQUEZ (aka Tab)";
|
||||||
|
|
||||||
|
my $pattern_ip =
|
||||||
|
"[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}";
|
||||||
|
|
||||||
|
my ($opt_download, $opt_upload) = 0;
|
||||||
|
my $opt_dnsresolve = 1;
|
||||||
|
my $opt_normalize = 1;
|
||||||
|
#my $opt_config = 1;
|
||||||
|
my $opt_config = 0;
|
||||||
|
my $opt_file = "/var/log/net-acct/net-acct.log.0";
|
||||||
|
my $opt_configfile = "/etc/analyse.conf";
|
||||||
|
my $opt_host = "";
|
||||||
|
my $opt_mail = "";
|
||||||
|
my $opt_number = -1;
|
||||||
|
my $bad_arg = 0;
|
||||||
|
my $period = 1;
|
||||||
|
$opt_upload = 1;
|
||||||
|
|
||||||
|
######## ERROR GEST ########
|
||||||
|
# USAGE: affiche en cas d'erreur dans les arguments.
|
||||||
|
|
||||||
|
sub usage
|
||||||
|
{
|
||||||
|
print "Usage:\tanalyse (-d) [-h <host>][-m <to>][-n <nb>][-f <file>]\n\n";
|
||||||
|
|
||||||
|
print "\t-d, --download\tTri la base sur le download\n";
|
||||||
|
print "\t-h, --host\tResume des connexions effectues par la machine <host>\n";
|
||||||
|
print "\t-n, --nombre\tChoisi le nombre de lignes affichees\n";
|
||||||
|
print "\t-m, --mail\tEnvoie la sortie par mail a <to>\n";
|
||||||
|
print "\t-f, --file\tSpecifie le fichier qui sera analyse\n";
|
||||||
|
print "\t-c, --config\tSpecifie le fichier de configuration\n";
|
||||||
|
print "\t --nodns\tNe resout pas les noms DNS\n";
|
||||||
|
print "\t --nonorm\tNe transforme pas les nombres en forme plus lisible (Ko, Mo, Go)\n";
|
||||||
|
print "\t --today\tChiffres du jour, analyse de /var/log/net-acct/net-acct.log\n";
|
||||||
|
print "\t --noconfig\tNe charge pas les options du fichier de config\n";
|
||||||
|
print "\t --noperiod\tN'affiche pas la période sur laquelle porte l'analyse\n";
|
||||||
|
print "\t --help\tAffiche cette aide\n";
|
||||||
|
print "\n";
|
||||||
|
print "par defaut si l'option n'est pas utilise:\n";
|
||||||
|
print "\tdownload = on tri sur l'upload\n";
|
||||||
|
print "\tnombre = tout est affiche\n";
|
||||||
|
print "\tfile = analyse de /var/log/net-acct/net-acct.log.0\n";
|
||||||
|
print "\tconfig = par defaut /etc/analyse.conf";
|
||||||
|
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
# SETOPT: gerer les options..
|
||||||
|
sub setopt
|
||||||
|
{
|
||||||
|
my ($opt_name, $opt_param) = @_;
|
||||||
|
if ($opt_name =~ /f/)
|
||||||
|
{ $opt_file = $opt_param; }
|
||||||
|
elsif ($opt_name =~ /h/)
|
||||||
|
{ $opt_host = $opt_param; }
|
||||||
|
elsif ($opt_name =~ /n/)
|
||||||
|
{ $opt_number = $opt_param; }
|
||||||
|
elsif ($opt_name =~ /c/)
|
||||||
|
{ $opt_configfile = $opt_param; }
|
||||||
|
elsif ($opt_name =~ /m/)
|
||||||
|
{ $opt_mail = $opt_param; }
|
||||||
|
}
|
||||||
|
|
||||||
|
# Readconfig
|
||||||
|
|
||||||
|
sub read_configfile
|
||||||
|
{
|
||||||
|
my $info = stat($opt_configfile) || die("Unable to open $opt_configfile");
|
||||||
|
my $config = AppConfig->new(
|
||||||
|
'normalize',
|
||||||
|
'dnsresolve',
|
||||||
|
'network' => { ARGCOUNT => 1 }
|
||||||
|
);
|
||||||
|
$config->file($opt_configfile);
|
||||||
|
$opt_normalize = $config->normalize();
|
||||||
|
$opt_dnsresolve = $config->dnsresolve();
|
||||||
|
$ip_interne = $config->network();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
########## FCT ###########
|
||||||
|
# SHOW_ALL: affiche toutes les machines
|
||||||
|
|
||||||
|
sub show_all
|
||||||
|
{
|
||||||
|
my %db;
|
||||||
|
|
||||||
|
my ($nb_to_print, $sort_by_upload) = @_;
|
||||||
|
|
||||||
|
# creation de la base
|
||||||
|
open (INPUT, $opt_file) || die ("Unable to open $opt_file");
|
||||||
|
while (my $line = <INPUT>) {
|
||||||
|
my ($src_ip, $dst_ip, $size) = (split "\t", $line)[2,4,6];
|
||||||
|
if ($src_ip =~ /$ip_interne/ )
|
||||||
|
{ $db{$src_ip}->{up} += $size; }
|
||||||
|
if ($dst_ip =~ /$ip_interne/ )
|
||||||
|
{ $db{$dst_ip}->{down} += $size; }
|
||||||
|
}
|
||||||
|
close(INPUT);
|
||||||
|
|
||||||
|
# Nombre d'entree a afficher
|
||||||
|
if ($nb_to_print == -1)
|
||||||
|
{ $nb_to_print = (my @nb = (keys %db)); }
|
||||||
|
|
||||||
|
my $max = (keys %db)[0];
|
||||||
|
|
||||||
|
# tris sur upload ou download
|
||||||
|
my $way1 = "up";
|
||||||
|
my $way2 = "down";
|
||||||
|
if ($sort_by_upload == 0)
|
||||||
|
{ $way1 = "down"; $way2 = "up"; }
|
||||||
|
|
||||||
|
# on affiche $nb_to_print entree, en ayant trier les machines
|
||||||
|
if ($period)
|
||||||
|
{
|
||||||
|
open (INPUT, $opt_file) || die ("Unable to open $opt_file");
|
||||||
|
my $line1 = <INPUT>;
|
||||||
|
my $firstdate = (split "\t", $line1)[0];
|
||||||
|
my $firstdate2 = strftime("Analyse depuis le %d-%m-%Y %H:%M:%S", localtime($firstdate));
|
||||||
|
print $firstdate2;
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
seek(INPUT, -90, 2);
|
||||||
|
my $lastlineX = <INPUT>;
|
||||||
|
my $lastline = <INPUT>;
|
||||||
|
my $lastdate = (split "\t", $lastline)[0];
|
||||||
|
my $lastdate2 = strftime(" jusq'au %d-%m-%Y %H:%M:%S", localtime($lastdate));
|
||||||
|
print $lastdate2;
|
||||||
|
print "\n";
|
||||||
|
close(INPUT);
|
||||||
|
|
||||||
|
print "\n";}
|
||||||
|
|
||||||
|
|
||||||
|
for (my $dec = $nb_to_print; $dec > 0; $dec--)
|
||||||
|
{
|
||||||
|
foreach my $ip (keys %db)
|
||||||
|
{
|
||||||
|
if (defined($db{$ip}->{$way1}) &&
|
||||||
|
$db{$max}->{$way1} <= $db{$ip}->{$way1})
|
||||||
|
{ $max = $ip; }
|
||||||
|
}
|
||||||
|
print normalize($db{$max}->{$way1})." (".
|
||||||
|
normalize($db{$max}->{$way2}).")\t".
|
||||||
|
ip_to_name($max)."\n" if ($db{$max}->{$way1} > 0);
|
||||||
|
$db{$max}->{$way1} = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
|
# GET_HOST_INFO: Affiche les informations sur une machine
|
||||||
|
sub get_host_info
|
||||||
|
{
|
||||||
|
my $total_size;
|
||||||
|
my %db;
|
||||||
|
my ($ip_search) = @_;
|
||||||
|
|
||||||
|
$total_size->{UPLOAD} = 0; $total_size->{DOWNLOAD} = 0;
|
||||||
|
|
||||||
|
# Must unresolve name
|
||||||
|
if (!($ip_search =~ /$pattern_ip/))
|
||||||
|
{ $ip_search = name_to_ip($ip_search); if ($ip_search eq "0") { return (-1); } }
|
||||||
|
|
||||||
|
# create db
|
||||||
|
open (INPUT, $opt_file) || die ("Unable to open $opt_file");
|
||||||
|
while (my $line = <INPUT>) {
|
||||||
|
my ($src_ip, $src_port, $dst_ip, $dst_port, $size) =
|
||||||
|
(split "\t", $line)[2,3,4,5,6];
|
||||||
|
if ($src_ip eq $ip_search) {
|
||||||
|
$total_size->{UPLOAD} += $size;
|
||||||
|
$db{$src_port}->{UPLOAD_LOCAL} += $size;
|
||||||
|
$db{$dst_port}->{UPLOAD_DIST} += $size;
|
||||||
|
}
|
||||||
|
if ($dst_ip eq $ip_search) {
|
||||||
|
$total_size->{DOWNLOAD} += $size;
|
||||||
|
$db{$dst_port}->{DOWNLOAD_LOCAL} += $size;
|
||||||
|
$db{$src_port}->{DOWNLOAD_DIST} += $size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close (INPUT);
|
||||||
|
|
||||||
|
# printing info
|
||||||
|
if ($period)
|
||||||
|
{
|
||||||
|
open (INPUT, $opt_file) || die ("Unable to open $opt_file");
|
||||||
|
my $line1 = <INPUT>;
|
||||||
|
my $firstdate = (split "\t", $line1)[0];
|
||||||
|
my $firstdate2 = strftime("Analyse depuis le %d-%m-%Y %H:%M:%S", localtime($firstdate));
|
||||||
|
print $firstdate2;
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
seek(INPUT, -90, 2);
|
||||||
|
my $lastlineX = <INPUT>;
|
||||||
|
my $lastline = <INPUT>;
|
||||||
|
my $lastdate = (split "\t", $lastline)[0];
|
||||||
|
my $lastdate2 = strftime(" jusqu'au %d-%m-%Y %H:%M:%S", localtime($lastdate));
|
||||||
|
print $lastdate2;
|
||||||
|
print "\n";
|
||||||
|
close(INPUT);
|
||||||
|
|
||||||
|
print "\n";}
|
||||||
|
print "--- Info for $ip_search ---";
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
foreach my $type ("UPLOAD", "DOWNLOAD")
|
||||||
|
{
|
||||||
|
print $type.": \t".normalize($total_size->{$type})."\n";
|
||||||
|
foreach my $location ("LOCAL", "DIST")
|
||||||
|
{
|
||||||
|
print "PORT $location: ";
|
||||||
|
|
||||||
|
my $max = (keys %db)[0];
|
||||||
|
for (my $dec=5; $dec > 0; $dec--) {
|
||||||
|
foreach my $port (keys %db) {
|
||||||
|
if (defined($db{$port}->{$type."_".$location}) &&
|
||||||
|
(! defined($db{$max}->{$type."_".$location}) ||
|
||||||
|
$db{$max}->{$type."_".$location} <=
|
||||||
|
$db{$port}->{$type."_".$location}))
|
||||||
|
{ $max = $port; }
|
||||||
|
}
|
||||||
|
print "$max(".normalize($db{$max}->{$type."_".$location}).") "
|
||||||
|
if ($db{$max}->{$type."_".$location} > 0);
|
||||||
|
$db{$max} ->{$type."_".$location} = 0;
|
||||||
|
}
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "--- Calculs ---\n";
|
||||||
|
print "Upload pur:\t".
|
||||||
|
normalize($total_size->{UPLOAD} - $total_size->{DOWNLOAD}/20);
|
||||||
|
foreach my $type ("UPLOAD", "DOWNLOAD")
|
||||||
|
{
|
||||||
|
print "\nTAUX $type:\t";
|
||||||
|
print normalize($total_size->{$type}/24)."/h - ";
|
||||||
|
print normalize($total_size->{$type}/1440)."/min - ";
|
||||||
|
print normalize($total_size->{$type}/86400)."/s";
|
||||||
|
}
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
###########################
|
||||||
|
######### TOOLKIT #########
|
||||||
|
# normalize: transforme un nombre, en un nombre suivi d'un prefixe
|
||||||
|
# Go, Mo, Ko, Octets.
|
||||||
|
|
||||||
|
sub normalize
|
||||||
|
{
|
||||||
|
my ($nb) = @_;
|
||||||
|
if ($opt_normalize)
|
||||||
|
{
|
||||||
|
if (defined $nb) {
|
||||||
|
if ($nb < 0)
|
||||||
|
{ return ("0o"); }
|
||||||
|
if ($nb > (1024*1024*1024))
|
||||||
|
{ return ((int($nb*100/(1024*1024*1024))/100)."Go"); }
|
||||||
|
elsif ($nb > (1024*1024))
|
||||||
|
{ return (int($nb/(1024*1024))."Mo"); }
|
||||||
|
elsif ($nb > 1024)
|
||||||
|
{ return (int($nb/(1024))."Ko"); }
|
||||||
|
else
|
||||||
|
{ return ($nb."o"); }
|
||||||
|
}
|
||||||
|
return ("0");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (defined $nb)
|
||||||
|
{ return ($nb); }
|
||||||
|
else
|
||||||
|
{ return (0); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ip_to_name: resout le nom associe a l'ip donne en argument
|
||||||
|
sub ip_to_name
|
||||||
|
{
|
||||||
|
my ($ip) = @_;
|
||||||
|
my $ret;
|
||||||
|
my $host_name;
|
||||||
|
my $aliases;
|
||||||
|
my $addrtype;
|
||||||
|
my $length;
|
||||||
|
my @addrs;
|
||||||
|
|
||||||
|
if (!($ip =~ /$pattern_ip/))
|
||||||
|
{ return ($ip); }
|
||||||
|
|
||||||
|
if ($opt_dnsresolve) {
|
||||||
|
my $ipaddr = pack("C4", split(/\./, $ip));
|
||||||
|
if (($host_name, $aliases, $addrtype, $length, @addrs)
|
||||||
|
= gethostbyaddr($ipaddr, 2))
|
||||||
|
{ return ($host_name); }
|
||||||
|
else
|
||||||
|
{ return ("$ip [lookup failed]"); }
|
||||||
|
}
|
||||||
|
return ($ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
# name_to_ip: deresout le nom
|
||||||
|
sub name_to_ip
|
||||||
|
{
|
||||||
|
my ($host) = @_;
|
||||||
|
my $line = "";
|
||||||
|
if ($host =~ /$pattern_ip/)
|
||||||
|
{ return ($host); }
|
||||||
|
open (COM, "host $host | awk '{print \$4}' |");
|
||||||
|
$line = <COM>;
|
||||||
|
close (COM);
|
||||||
|
if (! ($line =~ /$pattern_ip/))
|
||||||
|
{ print "host $host don't exist aborting\n"; return ("0");}
|
||||||
|
chomp($line);
|
||||||
|
return ($line);
|
||||||
|
}
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
# Lit les options de la ligne de commande
|
||||||
|
use Getopt::Long;
|
||||||
|
Getopt::Long::config ("bundling");
|
||||||
|
Getopt::Long::GetOptions
|
||||||
|
(
|
||||||
|
'v|version' => sub { print "analyse version $VERSION\n$AUTEUR\n"; },
|
||||||
|
'd|download' => sub { $opt_download = 1; $opt_upload = 0; },
|
||||||
|
'u|upload' => sub { $opt_upload = 1; $opt_download = 0; },
|
||||||
|
'c|config=s' => \&setopt,
|
||||||
|
'h|host=s' => \&setopt,
|
||||||
|
'f|file=s' => \&setopt,
|
||||||
|
'm|mail=s' => \&setopt,
|
||||||
|
'n|number=s' => \&setopt,
|
||||||
|
'help' => \&usage,
|
||||||
|
'nodns' => sub { $opt_dnsresolve = 0; },
|
||||||
|
'nonorm' => sub { $opt_normalize = 0; },
|
||||||
|
'noconfig' => sub { $opt_config = 0; },
|
||||||
|
'noperiod' => sub { $period = 0; },
|
||||||
|
'today' => sub { $opt_file = "/var/log/net-acct/net-acct.log"; }
|
||||||
|
) or $bad_arg = 1;
|
||||||
|
|
||||||
|
if ($bad_arg == 1)
|
||||||
|
{ usage(); }
|
||||||
|
|
||||||
|
my ($mail_msg, $mail_fh);
|
||||||
|
|
||||||
|
# Lit les options du fichier de config
|
||||||
|
# sauf si --noconfig est utilise
|
||||||
|
if ($opt_config)
|
||||||
|
{ read_configfile(); }
|
||||||
|
|
||||||
|
# Begin Mail ?
|
||||||
|
if ($opt_mail ne "")
|
||||||
|
{
|
||||||
|
$mail_msg = new Mail::Send;
|
||||||
|
$mail_msg->to($opt_mail);
|
||||||
|
$mail_msg->subject("[ANALYSE]");
|
||||||
|
$mail_fh = $mail_msg->open();
|
||||||
|
close (STDOUT);
|
||||||
|
open (STDOUT, ">/tmp/analyse_mail");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main Part
|
||||||
|
if ($opt_host ne "")
|
||||||
|
{ get_host_info($opt_host); }
|
||||||
|
else
|
||||||
|
{ show_all($opt_number, $opt_upload); }
|
||||||
|
|
||||||
|
# Close Mail
|
||||||
|
if ($opt_mail ne "")
|
||||||
|
{
|
||||||
|
close (STDOUT);
|
||||||
|
open (FH, "/tmp/analyse_mail") || die ("argh not possible !\n");
|
||||||
|
while (my $line = <FH>)
|
||||||
|
{ print $mail_fh $line; }
|
||||||
|
close (FH);
|
||||||
|
$mail_fh->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
84
archive/archives/analyse_komaz/analyse.cron
Executable file
84
archive/archives/analyse_komaz/analyse.cron
Executable file
|
@ -0,0 +1,84 @@
|
||||||
|
#!/bin/sh
|
||||||
|
##
|
||||||
|
## Analyse
|
||||||
|
##
|
||||||
|
## Made by Tab <rv@crans.org>
|
||||||
|
##
|
||||||
|
## Started on Tue 09 Oct 2001 01:28:25 AM CEST tab
|
||||||
|
## MAJ : 06/02/2003 -- Fred
|
||||||
|
|
||||||
|
TEMPFILE="/tmp/analyse.mail"
|
||||||
|
|
||||||
|
# Options pour les stats traffic
|
||||||
|
PROG="/usr/scripts/analyse_komaz/nacct.py"
|
||||||
|
OPTIONS="-N 15"
|
||||||
|
OPTIONS2="-N 15 -c 2"
|
||||||
|
OPTIONS3="-N 15 -c 5"
|
||||||
|
|
||||||
|
# Divers chemins
|
||||||
|
BLACKLIST="/var/zamok/CRANS/blacklist.cf"
|
||||||
|
AUTODISC_LOG="/var/log/autodisconnect.log"
|
||||||
|
VIRUS_BLACKLIST="/tmp/virus_blacklist"
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# Machines ayant été disconnectées dans les 24h :
|
||||||
|
# affichage de leur historique
|
||||||
|
|
||||||
|
echo "Bilan des autodisconnexions des dernières 24h :" >> $TEMPFILE
|
||||||
|
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $TEMPFILE
|
||||||
|
|
||||||
|
if [ -e $AUTODISC_LOG ]; then
|
||||||
|
for host in $(awk -F'[ .]' '/'$(date --date=yesterday +%d-%m-%Y)'-(0[7-9]|1|2)|'$(date +%d-%m-%Y)'-0[0-6]/ {print $2}' $AUTODISC_LOG)
|
||||||
|
do
|
||||||
|
echo "$host :"
|
||||||
|
( awk -F'-' '/'$host'.crans.org/ {print $3$2"@"$1"/"$2"/"$3" : autodisconnecté"}' $AUTODISC_LOG
|
||||||
|
awk -F'[:/ ]' '/^'$host'/ || /^#'$host'/ {print $6$5"@"$4"/"$5"/"$6" : déco manuelle (->"$7"/"$8"/"$9")"}' $BLACKLIST ) \
|
||||||
|
| sort -r \
|
||||||
|
| awk -F@ '{print "\t"$2}'
|
||||||
|
done >> $TEMPFILE
|
||||||
|
else
|
||||||
|
echo -e "Problème avec $AUTODISC_LOG" >> $TEMPFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n" >> $TEMPFILE
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# Vérolés
|
||||||
|
|
||||||
|
if [ -e $VIRUS_BLACKLIST ]; then
|
||||||
|
echo "Bilan des bloquages web pour virus :" >> $TEMPFILE
|
||||||
|
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" >> $TEMPFILE
|
||||||
|
|
||||||
|
echo "Il y a $(wc -l $VIRUS_BLACKLIST | awk '{print $1}') machines infectées." >> $TEMPFILE
|
||||||
|
|
||||||
|
if [ -e $VIRUS_BLACKLIST.hier ] ; then
|
||||||
|
diff -U0 -s $VIRUS_BLACKLIST.hier $VIRUS_BLACKLIST \
|
||||||
|
| egrep -v '\-\-\-|\+\+\+|@@' >> $TEMPFILE
|
||||||
|
else
|
||||||
|
cat $VIRUS_BLACKLIST >> $TEMPFILE
|
||||||
|
fi
|
||||||
|
cp -f $VIRUS_BLACKLIST $VIRUS_BLACKLIST.hier
|
||||||
|
echo -e "\n" >> $TEMPFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# Statistiques
|
||||||
|
|
||||||
|
echo "Statistiques upload/download :" >> $TEMPFILE
|
||||||
|
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" >> $TEMPFILE
|
||||||
|
|
||||||
|
if [ -x $PROG ]; then
|
||||||
|
echo -e "Upload (Download) pur normal :\n" >> $TEMPFILE
|
||||||
|
$PROG $OPTIONS | tail -15 | awk -F "|" '{print $1" ("$3")"" "$7}' >> $TEMPFILE
|
||||||
|
echo -e "\nUpload total normal :\n" >> $TEMPFILE
|
||||||
|
$PROG $OPTIONS2 | tail -15 | awk -F "|" '{print $2" "$7}' >> $TEMPFILE
|
||||||
|
echo -e "\nUpload total exempté :\n" >> $TEMPFILE
|
||||||
|
$PROG $OPTIONS3 | tail -15 | awk -F "|" '{print $5" "$7}' >> $TEMPFILE
|
||||||
|
else
|
||||||
|
echo -e "Problème avec $PROG" >> $TEMPFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# Envoi du mail
|
||||||
|
cat $TEMPFILE |/usr/bin/mail -s "Stats -- $(date --date=yesterday +%A\ %d\ %B\ %Y)" disconnect@crans.org
|
||||||
|
rm -f $TEMPFILE
|
215
archive/archives/analyse_komaz/autodisconnect
Executable file
215
archive/archives/analyse_komaz/autodisconnect
Executable file
|
@ -0,0 +1,215 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
##
|
||||||
|
## autodisconnect
|
||||||
|
##
|
||||||
|
## Made by stransky
|
||||||
|
## Login stransky <stransky@crans.org>
|
||||||
|
##
|
||||||
|
## Started on ven 25 jan 2002 22:24:26 CEST Nicolas STRANSKY
|
||||||
|
## Last update lun 03 nov 2003 07:38:51 CET Nicolas STRANSKY
|
||||||
|
##
|
||||||
|
## script de surveillance automatique de l'upload.
|
||||||
|
## à lancer par cron.
|
||||||
|
|
||||||
|
export LANG=fr_FR@euro
|
||||||
|
|
||||||
|
LIMITE_SOFT=100
|
||||||
|
LIMITE_HARD=700
|
||||||
|
MAIL_INTERVAL=100
|
||||||
|
LOG=/var/log/autodisconnect.log
|
||||||
|
LOGFILE=/var/log/net-acct/net-acct.log
|
||||||
|
outpF=$(mktemp)
|
||||||
|
TEMPFILE=/tmp/uploaders
|
||||||
|
LISTFILE=/tmp/liste
|
||||||
|
EMPREINTE_NEW=/tmp/empreinte-new
|
||||||
|
EMPREINTE=/tmp/empreinte
|
||||||
|
HABITUES=/tmp/habitues # Liste des habitués du système
|
||||||
|
BLACKLISTES=/tmp/blacklistes
|
||||||
|
BLACKLISTES_NEW=${BLACKLISTES}-new
|
||||||
|
BLACKLISTE_ZAMOK=/var/zamok/CRANS/blacklist.cf
|
||||||
|
VERIF=0 # on envoie un mail à disconnect si VERIF=1
|
||||||
|
RENEW=1 # si cette valeur reste à 1 on vide le fichier empreinte.
|
||||||
|
date=$(date +%A\ %d\ %B\ %Y\ \ %T)
|
||||||
|
date2=$(date +%A\ %d\ %B\ %Y)
|
||||||
|
date3=$(date +%d-%m-%Y-%T)
|
||||||
|
DIR=/usr/scripts/analyse_komaz
|
||||||
|
|
||||||
|
# Si /tmp/exempts.pickle n'existe pas, on relance exempts.py
|
||||||
|
if [ ! -f /tmp/exempts.pickle ]; then
|
||||||
|
$DIR/exempts.py
|
||||||
|
fi
|
||||||
|
|
||||||
|
# On renforce déjà la blacklist (au cas où le firewall a été relancé)
|
||||||
|
if [ -f $BLACKLISTES ]; then
|
||||||
|
while read machine ; do
|
||||||
|
if ! (/sbin/iptables -nL BLACKLIST_SRC | grep -q "^REJECT.*$machine "); then
|
||||||
|
/sbin/iptables -I BLACKLIST_SRC -s $machine -j REJECT
|
||||||
|
echo blacklist $machine
|
||||||
|
fi
|
||||||
|
done < $BLACKLISTES
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Retourne l'adresse email correspondant à la machine donnée en paramètre
|
||||||
|
# Le premier paramètre est le nom de la machine en FQDN (lucas.crans.org)
|
||||||
|
getAdresseMail() {
|
||||||
|
# Quel est l'adhérent de la machine ?
|
||||||
|
aid=$(ldapsearch -LLL -H ldaps://sila.crans.org -x -D "cn=admin,dc=crans,dc=org" \
|
||||||
|
-w $(cat /etc/ldap.secret) -b "ou=data,dc=crans,dc=org" \
|
||||||
|
host=$1 dn | head -1 | awk -F, '{print $2}')
|
||||||
|
# On affiche son adresse email
|
||||||
|
mail=$(ldapsearch -LLL -H ldaps://sila.crans.org -x -D "cn=admin,dc=crans,dc=org" \
|
||||||
|
-w $(cat /etc/ldap.secret) -b "ou=data,dc=crans,dc=org" $aid \
|
||||||
|
mail | awk -F': ' '($1 ~ /^mail$/) {if ($2 ~ /@/) print $2; else print $2"@crans.org"}')
|
||||||
|
if [[ -z $mail ]]; then
|
||||||
|
echo disconnect@crans.org
|
||||||
|
else
|
||||||
|
echo $mail
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $date > $LISTFILE
|
||||||
|
echo " " >> $LISTFILE
|
||||||
|
|
||||||
|
#/usr/scripts/analyse.pl -u -n 10 -f $LOGFILE --noperiod | egrep -v "zamok|komaz|sila" | \
|
||||||
|
#grep -v "Ko" | awk '{print $1" "$3}' | sed 's/Mo/ /g' | sed 's/\.[0-9]*Go/000 /g' > $TEMPFILE
|
||||||
|
|
||||||
|
$DIR/nacct.py -n -N 25| grep -v 'NoDNS_' > $outpF
|
||||||
|
if [ $? -eq 255 ]; then
|
||||||
|
echo "Problème avec nacct.py : lock"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat $outpF | tail -25 | awk -F "|" '{print $1" "$7}' | egrep -v "136\.(1|2|3|4|6|8|9|10)$" > $TEMPFILE
|
||||||
|
|
||||||
|
# Pour conserver un historique de la sortie de nacct.py
|
||||||
|
echo -e "\n$date" >> /tmp/nacct_history
|
||||||
|
cat $outpF >> /tmp/nacct_history
|
||||||
|
|
||||||
|
if ! grep -q "^===========================================================================" $outpF ; then
|
||||||
|
echo "Pas de données ; problème avec nacct"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm $outpF
|
||||||
|
|
||||||
|
while read upload machine ; do # On lit dans $TEMPFILE
|
||||||
|
if ! (/sbin/iptables -nL BLACKLIST_SRC | grep -q "^REJECT.*$machine ") && [ $( echo $upload | cut -d '.' -f 1 ) -ge $LIMITE_SOFT ]
|
||||||
|
then # Si la machine dépasse la limite soft et n'est pas déjà blacklistée,
|
||||||
|
RENEW=0 # on ne vide pas le fichier empreinte
|
||||||
|
hostname=`host $machine | awk '/Name:/ {print $2}'`
|
||||||
|
if [ $( echo $upload | cut -d '.' -f 1 ) -ge $LIMITE_HARD ]
|
||||||
|
then
|
||||||
|
/sbin/iptables -I BLACKLIST_SRC -s $machine -j REJECT
|
||||||
|
echo blacklist $hostname
|
||||||
|
echo "$hostname FIREWALISÉ ! ($upload Mo)" >> $LISTFILE
|
||||||
|
echo "$date3 $hostname $upload" >> $LOG
|
||||||
|
echo "$machine" >> $BLACKLISTES
|
||||||
|
VERIF=1
|
||||||
|
# Envoi d'un mail pour prévenir la personne (à modifier pour éventuellement utiliser sendmail)
|
||||||
|
# On doit tester la variable EMAIL ?
|
||||||
|
EMAIL=$(getAdresseMail $hostname)
|
||||||
|
echo $EMAIL
|
||||||
|
cat <<EOF | mail -s "Deconnexion temporaire de $hostname" -a "From: disconnect@crans.org" -a "Reply-To: disconnect@crans.org" $EMAIL
|
||||||
|
Bonjour,
|
||||||
|
|
||||||
|
Ta machine $hostname a été temporairement déconnectée parce que tu uploadais
|
||||||
|
une quantité importante de données. Tu recevras dans moins de 24h
|
||||||
|
un mail indiquant ta reconnexion. Tu as toujours accès au web ainsi qu'à tes mails
|
||||||
|
mais les autres services sont suspendus. Si cela se renouvelle trop souvent, tu
|
||||||
|
risques d'être déconnecté entièrement pour une durée plus importante. Il
|
||||||
|
t'appartient donc de surveiller cela de plus près et de faire en sorte que ta
|
||||||
|
machine n'uploade pas de manière excessive à l'avenir.
|
||||||
|
|
||||||
|
Pour plus d'informations, tu peux consulter la page:
|
||||||
|
http://wiki.crans.org/moin.cgi/VieCrans_2fD_e9connexionPourUpload
|
||||||
|
Si tu as des questions, contacte disconnect@crans.org
|
||||||
|
EOF
|
||||||
|
elif ! (grep -q $hostname $EMPREINTE) # si la machine n'a pas encore été repérée par autodisconnect
|
||||||
|
then
|
||||||
|
EMAIL=$(getAdresseMail $hostname)
|
||||||
|
# On évince les habitués, ils reçoivent assez de mails comme ça
|
||||||
|
if ! (grep -q $EMAIL $HABITUES); then
|
||||||
|
echo "$hostname uploade ($upload Mo)" >> $LISTFILE
|
||||||
|
echo "$hostname $upload" >> $EMPREINTE_NEW
|
||||||
|
VERIF=1 # Pas d'envoi de mail dans ce cas
|
||||||
|
cat <<EOF | mail -s "Ta machine $hostname uploade" -a "From: disconnect@crans.org" -a "Reply-To: disconnect@crans.org" $EMAIL
|
||||||
|
Bonjour,
|
||||||
|
|
||||||
|
Ta machine $hostname uploade une quantité importante de données vers l'extérieur
|
||||||
|
(actuellement, $upload Mo). Si cela continuait, elle serait automatiquement
|
||||||
|
déconnectée pour une durée d'environ 24 heures. Il t'appartient donc de
|
||||||
|
surveiller cela de plus près et de faire en sorte que ta machine n'uploade pas
|
||||||
|
de manière excessive à l'avenir.
|
||||||
|
|
||||||
|
Pour plus d'informations, tu peux consulter la page:
|
||||||
|
http://wiki.crans.org/moin.cgi/VieCrans_2fD_e9connexionPourUpload
|
||||||
|
Si tu as des questions, contacte disconnect@crans.org
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ `echo $upload | cut -d '.' -f 1` -gt `echo $(cat $EMPREINTE | \
|
||||||
|
awk -v MACHINE=$hostname '$0 ~ MACHINE {print $2}')"/1+$MAIL_INTERVAL"|bc` ]
|
||||||
|
# si la machine a uploadé $MAIL_INTERVAL Mo de plus que la dernière
|
||||||
|
# fois qu'on a envoyé un mail à son sujet, on renvoie un mail.
|
||||||
|
then
|
||||||
|
echo "$hostname uploade encore. ($upload Mo)" >> $LISTFILE
|
||||||
|
echo "$hostname $upload" >> $EMPREINTE_NEW
|
||||||
|
else # sinon on conserve les infos sur la machine
|
||||||
|
cat $EMPREINTE | grep $hostname >> $EMPREINTE_NEW
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done < $TEMPFILE
|
||||||
|
|
||||||
|
|
||||||
|
if [ $RENEW -eq 1 ] ; then cat /dev/null > $EMPREINTE ; fi
|
||||||
|
if [ -f $EMPREINTE_NEW ] ; then mv $EMPREINTE_NEW $EMPREINTE ; fi
|
||||||
|
|
||||||
|
# Reconnexion des machines déconnectées
|
||||||
|
|
||||||
|
rm -f $BLACKLISTES_NEW
|
||||||
|
if [ -f $BLACKLISTES ]; then
|
||||||
|
while read machine ; do
|
||||||
|
# Est-ce que cette machine est toujours dans le TOP 12 ?
|
||||||
|
|
||||||
|
# Juste pour vérifier où se situe le problème -- Nico
|
||||||
|
echo "$machine firewalisé en est encore à : $(awk '($2 == "'$machine'") {print $1}' $TEMPFILE)"
|
||||||
|
|
||||||
|
if ! (grep -q $machine'$' $TEMPFILE) || \
|
||||||
|
[ $LIMITE_SOFT -ge $(awk '($2 == "'$machine'") {print $1}' $TEMPFILE | cut -d '.' -f 1 ) ]; then
|
||||||
|
VERIF=1
|
||||||
|
# On doit la reconnecter : on la vire de BLACKLISTES
|
||||||
|
grep -v $machine $BLACKLISTES > $BLACKLISTES_NEW
|
||||||
|
hostname=`host $machine | awk '/Name:/ {print $2}'`
|
||||||
|
# Reconnexion
|
||||||
|
if ! (grep -q "^$(echo $hostname | cut -f1 -d.)" $BLACKLISTE_ZAMOK )
|
||||||
|
then # Si la machine est blacklistée sur zamok on ne reconnecte pas
|
||||||
|
/sbin/iptables -D BLACKLIST_SRC -s $machine -j REJECT
|
||||||
|
echo "La machine $hostname a été reconnectée. ($(awk '($2 == "'$machine'") {print $1}' $TEMPFILE) Mo)" >> $LISTFILE
|
||||||
|
EMAIL=$(getAdresseMail $hostname)
|
||||||
|
cat <<EOF | mail -s "Reconnexion de $hostname" -a "From: disconnect@crans.org" -a "Reply-To: disconnect@crans.org" $EMAIL
|
||||||
|
Bonjour,
|
||||||
|
|
||||||
|
Ta machine $hostname avait été temporairement déconnectée, elle est maintenant
|
||||||
|
reconnectée. Vérifie que tu ne fais plus d'upload pour éviter de te faire
|
||||||
|
déconnecter une nouvelle fois.
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
echo "La machine $hostname reste blacklisstée sur zamok. ($(awk '($2 == "'$machine'") {print $1}' $TEMPFILE) Mo)" >> $LISTFILE
|
||||||
|
fi
|
||||||
|
echo reconnexion $machine
|
||||||
|
fi
|
||||||
|
done < $BLACKLISTES
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Bug, on n'enlève qu'une machine à chaque fois, pas trop grave
|
||||||
|
if [ -f $BLACKLISTES_NEW ]; then cat $BLACKLISTES_NEW > $BLACKLISTES; fi
|
||||||
|
# Eventuellement, appel de firewall blacklist si on n'a pas encore reconnecté
|
||||||
|
|
||||||
|
if [ $VERIF -eq 1 ]
|
||||||
|
then
|
||||||
|
echo -e "\n-- \ncréé par autodisconnect." >> $LISTFILE
|
||||||
|
|
||||||
|
cat $LISTFILE | /usr/bin/mail -s "upload temps réel - $date2" -a "From: disconnect@crans.org" -a "Reply-To: disconnect@crans.org" pessoles@crans.org
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
42
archive/archives/analyse_komaz/exempts.py
Executable file
42
archive/archives/analyse_komaz/exempts.py
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
#! /usr/bin/env python
|
||||||
|
# -*- encoding: iso-8859-15 -*-
|
||||||
|
|
||||||
|
|
||||||
|
import cPickle,re
|
||||||
|
|
||||||
|
exempts = { 'dst' : [], 'src_dst' : {} }
|
||||||
|
|
||||||
|
"""
|
||||||
|
exempts['dst'] : liste de réseaux (exprimés en regex) vers lesquels le traffic est exempté
|
||||||
|
exempts['src_dst'] [ IP ] : idem, mais seulement en provenance de IP.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
exempts['dst'].append( '138\.231\..*' ) # * => *.ens-cachan.fr
|
||||||
|
|
||||||
|
exempts['src_dst']['138.231.149.10'] = ['134\.157\.96\.216'] # rivendell.wifi.crans.org => *.ccr.jussieu.fr
|
||||||
|
exempts['src_dst']['138.231.141.187'] = ['129\.104\.17\..*', '134\.157\.96\.216' ] # barad-dur.crans => *.polytechnique.fr et *.ccr.jussieu.fr
|
||||||
|
exempts['src_dst']['138.231.136.7'] = ['195\.221\.21\.36'] # egon => ftp.crihan.fr pour rsync mirroir debian/fedor
|
||||||
|
exempts['src_dst']['138.231.143.62'] =['193\.49\.25\.152' , '138\.195\.34\..*' ] # ogre => centrale / labo fast (psud)
|
||||||
|
exempts['src_dst']['138.231.140.173'] =['195\.220\.131\.33' , '195\.220\.133\.98' ] # duckien => rebol.ephe.sorbonne.fr oss.ephe.sorbonne.fr, 28/1/2005 -- Bilou
|
||||||
|
exempts['src_dst']['138.231.137.230'] =['129\.175\.100\.221' ] # helene => orsay
|
||||||
|
exempts['src_dst']['138.231.136.7'] =['138\.195\..*' ] # egon => centrale paris
|
||||||
|
exempts['src_dst']['138.231.139.106'] =['138\.195\.74\..*' ] # schuss => centrale paris
|
||||||
|
exempts['src_dst']['138.231.139.106'] =['138\.195\.75\..*' ] # schuss => centrale paris
|
||||||
|
exempts['src_dst']['138.231.150.106'] =['157\.99\.164\.27' ] # sayan-ftp.wifi => chile.sysbio.pasteur.fr
|
||||||
|
|
||||||
|
def compileRegs( exempts) :
|
||||||
|
L = []
|
||||||
|
for s in exempts['dst'] :
|
||||||
|
L.append( re.compile(s) )
|
||||||
|
exempts['dst'] = L
|
||||||
|
for k in exempts['src_dst'].keys() :
|
||||||
|
L = []
|
||||||
|
for s in exempts['src_dst'] [k] :
|
||||||
|
L.append( re.compile(s) )
|
||||||
|
exempts['src_dst'] [k] = L
|
||||||
|
|
||||||
|
|
||||||
|
compileRegs( exempts )
|
||||||
|
fd=open("/tmp/exempts.pickle","wb")
|
||||||
|
cPickle.dump(exempts, fd)
|
28
archive/archives/analyse_komaz/flood_scan.awk
Executable file
28
archive/archives/analyse_komaz/flood_scan.awk
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/awk -f
|
||||||
|
#Lecture des logs du firewall pour retourner la liste des machines floodant
|
||||||
|
#
|
||||||
|
#Arguments :
|
||||||
|
#<fichier(s) à scanner> <autre fichier donc le nom contient blacklist>
|
||||||
|
# Le second fichier contient les IP des machines supplémentaires à sortir.
|
||||||
|
#
|
||||||
|
# Format de sortie : Mois jour hh:mm:ss hostname nb_attques
|
||||||
|
#
|
||||||
|
# 02/2003 Frédéric Pauget
|
||||||
|
|
||||||
|
{ if (FILENAME~"blacklist") {
|
||||||
|
if ($0=="") nextfile;
|
||||||
|
tentatives[$0]=0;
|
||||||
|
dern_tentative[$0]="Vieux 00 00:00:00"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/.*Flood:IN=eth0.*/ {
|
||||||
|
gsub("SRC=","",$9);
|
||||||
|
tentatives[$9]++;
|
||||||
|
dern_tentative[$9]=$1" "$2" "$3;
|
||||||
|
}
|
||||||
|
|
||||||
|
END{
|
||||||
|
for (machine in tentatives){
|
||||||
|
system("echo "dern_tentative[machine]" $(host "machine" 2>/dev/null | awk '/^Name/ {print $2}') "tentatives[machine])
|
||||||
|
}
|
||||||
|
}
|
12
archive/archives/analyse_komaz/keys/reload_squid
Normal file
12
archive/archives/analyse_komaz/keys/reload_squid
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
-----BEGIN DSA PRIVATE KEY-----
|
||||||
|
MIIBuwIBAAKBgQDVcolphFz43syoaLG493G6rrZn3Jn6rr/4ur6MkLd1up3/nejW
|
||||||
|
VRgpJ4YkVQjjFwyPkN+jRE0TTnQrHM2SF8/y4o3FU/IPl2R6VjjCJj4lMTdBzU6B
|
||||||
|
POuW4VB5UdFE8iUESciCdznQtdQa8V5B8X8M8ONIFfGuVLNwL7TEhimMmwIVAMaQ
|
||||||
|
gPvdJou3MrXbzJO0LEOk49e7AoGAR1g8pp6HDbLg4aDLfU28JrgL5IJdCEmRg2ro
|
||||||
|
76wkcFLNNJkRapl2piRkIKF2cYxz80qX8XhidEFF0HV7d6fBQxdhCq/1IP0c1DDd
|
||||||
|
CeUmf16sG8mNo+yIDcz7TlZO+1pAUmgUJo+p33+tVkYcTrSMhYZuTuLPZQTwsoEo
|
||||||
|
4YHnftUCgYEAmHVzjTbE8EayE9uhwoIu9FEqV4Cc1LwHeUDFv4bnMx+RDbiNKTSW
|
||||||
|
AI9BbjhJparm7v40sd4VLlCtMuo1qdjXRxczSCLAGsYADSihNTREXUM0QpF8WGkU
|
||||||
|
nBYI/Hls1sLosoe1a5LNgdlj7Mcuy6YLRh4E5VlAss2pCpNtsyV7x6gCFD6C4YFb
|
||||||
|
kpcdKEVsLs4OR0sO6ErH
|
||||||
|
-----END DSA PRIVATE KEY-----
|
12
archive/archives/analyse_komaz/keys/synchro_virus
Normal file
12
archive/archives/analyse_komaz/keys/synchro_virus
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
-----BEGIN DSA PRIVATE KEY-----
|
||||||
|
MIIBvAIBAAKBgQCpQTAp6QoAFb2S3T2K7MKUlhyON8ffPj8urJH7AuiJ3QhzqCi2
|
||||||
|
VTb0YnM7xwZqPfpikVFNk7JX9T52IpHiOzqol/f/O7Gfjb53IqXmVr4fSBCOGsXG
|
||||||
|
zvJ2cXSuxk5uOewWreMChDYA9FWpjcA5BShHYPEKR332Y7vmyeJb482WbQIVAPsA
|
||||||
|
VphrX509AFqNbqTo6VdGQ8SxAoGAY87lkq9vVLDId6zy0+JlM8cPCa2ZqQJVnUWo
|
||||||
|
Wu5laBAoacrkJEAzKGY2zFVKNkiUh+biqQtBFc3a+2DW1zW1fCqUuVhWZcQafRB7
|
||||||
|
QiZqYdIQm87lC+UIzQyTRD6Qt2v0WWDYdLgFaekoxAV0NeXQXd9dLRAGFzbwhIFS
|
||||||
|
7djTZq0CgYEAqAbx6tBT01OZg8w8gq+FCRh2gQYL/XbdDtBAlNHZD75b9BL1ZZwj
|
||||||
|
NWQccVddsRZ59CxX8BigynGDAW3n/vYEg8oFPtuXtpcg+X4cUe496GttIamLDMkf
|
||||||
|
nNSQ4O5asJw9yJBElx+DpHsmHmCOKWw+MEDAdmAoomspNQGFiwn0KUgCFQC6XHx7
|
||||||
|
k5LurZXoG6YS67wXne9qzA==
|
||||||
|
-----END DSA PRIVATE KEY-----
|
572
archive/archives/analyse_komaz/nacct.py
Executable file
572
archive/archives/analyse_komaz/nacct.py
Executable file
|
@ -0,0 +1,572 @@
|
||||||
|
#! /usr/bin/env python
|
||||||
|
# -*- encoding: iso-8859-15 -*-
|
||||||
|
|
||||||
|
## (C) Samuel Krempp 2001
|
||||||
|
## krempp@crans.ens-cachan.fr
|
||||||
|
## Permission to copy, use, modify, sell and
|
||||||
|
## distribute this software is granted provided this copyright notice appears
|
||||||
|
## in all copies. This software is provided "as is" without express or implied
|
||||||
|
## warranty, and with no claim as to its suitability for any purpose.
|
||||||
|
|
||||||
|
import os,sys,string,re,getopt,time
|
||||||
|
import cPickle # load/dump python objects
|
||||||
|
import socket
|
||||||
|
|
||||||
|
""" nacct.py : parse the logs+dump of net-acct, then print a summary of the last 24h
|
||||||
|
|
||||||
|
Usage : nacct.py [-N 20 ] : display the top-20
|
||||||
|
[-c 1] : sort by the first column.
|
||||||
|
[-n] : display numeric IP (instead of resolved hostnames)
|
||||||
|
[-p nacct.pickle ] : where to put the persistence file
|
||||||
|
[-f net-acct.log] [-f net.acct.log.0] [-u net-acct.dump]
|
||||||
|
[-T <duree> = 24 ] : analyse data of the last <duree> hours
|
||||||
|
[-T <duree2>= 2 ] : store data of the last <duree2> days.
|
||||||
|
[-h host] : prints details for given host, from the *persistent* file only.
|
||||||
|
[-t <date>=current time] : choose current time
|
||||||
|
e.g. : nacct.py -h toto.crans.org -t '2002 12 31 23:59' -T 48
|
||||||
|
will print details for toto on the 48 hours before given time.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def isExempt(exempts, src_ip, dst_ip) :
|
||||||
|
is_exempt=0
|
||||||
|
for r in exempts['dst'] :
|
||||||
|
if r.search(dst_ip) :
|
||||||
|
is_exempt = 1
|
||||||
|
break
|
||||||
|
if is_exempt ==0 :
|
||||||
|
if exempts['src_dst'].has_key(src_ip) :
|
||||||
|
tmp=exempts['src_dst'][src_ip]
|
||||||
|
for r in tmp :
|
||||||
|
if r.search(dst_ip) :
|
||||||
|
is_exempt=1
|
||||||
|
break
|
||||||
|
return is_exempt
|
||||||
|
|
||||||
|
|
||||||
|
def parseInputUntil ( f, prevline, conns_DB, exempts, end_time) :
|
||||||
|
""" reads lines of the file f _until_ the timestamp is >= end_time
|
||||||
|
data structure :
|
||||||
|
. exempts [ src ] [ dst ] : if exists, count this traffic separately ('exempted' bytes)
|
||||||
|
. conns_DB [ IP ] = [ PURE_upload_bytes, upload_bytes, download_bytes # normal bytes
|
||||||
|
, gPUL, gUL, gDL ] # 'exempted' bytes
|
||||||
|
(i.e. there are 6 counters, 3 for normal bytes, 3 for exempted bytes)
|
||||||
|
|
||||||
|
optionnally, prev_line is a line to be parsed before processing the file
|
||||||
|
(used because we read next line's timestamps)
|
||||||
|
Returns : (nextline, last_time, got_nothing)
|
||||||
|
. nextLine : similar to prevLine
|
||||||
|
. last_time : a timestamp such that : . all read timeStamps are <= last_time
|
||||||
|
. all unread timeStamps are > last_time
|
||||||
|
in practice, last_time is either the greatest read timeStamp, or (nextline's timestamp) - 1
|
||||||
|
. got_nothing : true iff the file was completely empty.
|
||||||
|
"""
|
||||||
|
got_nothing = 1
|
||||||
|
nextline = "" # in case a line needs to be parsed at next call..
|
||||||
|
last_time = 0
|
||||||
|
|
||||||
|
t=0
|
||||||
|
src_ip=""
|
||||||
|
dst_ip=""
|
||||||
|
size=0
|
||||||
|
|
||||||
|
# local variable aliases (optimising lookup..)
|
||||||
|
lsplit = string.split; llong=long;
|
||||||
|
lregLAN=regLAN
|
||||||
|
end_time=repr(end_time)
|
||||||
|
|
||||||
|
(prev_stime, prev_proto, prev_src_ip, prev_src_port, prev_dst_ip, prev_dst_port, prev_size, pd)\
|
||||||
|
= ["" ] * 8
|
||||||
|
prev_is_symmetric = 1
|
||||||
|
prev_m_src = 0
|
||||||
|
|
||||||
|
lineN=0
|
||||||
|
while(1) :
|
||||||
|
if not prevline :
|
||||||
|
line = f.readline()
|
||||||
|
lineN += 1
|
||||||
|
else :
|
||||||
|
line = prevline
|
||||||
|
prevline=""
|
||||||
|
|
||||||
|
if not line : break
|
||||||
|
got_nothing = 0
|
||||||
|
|
||||||
|
(stime, proto, src_ip, src_port, dst_ip, dst_port, size, pd) = lsplit(line, '\t', 7)
|
||||||
|
|
||||||
|
if stime >= end_time :
|
||||||
|
nextline=line
|
||||||
|
# if a whole slice is absent in logs, we need to set last_time here :
|
||||||
|
if last_time =="" : last_time = int(stime) - 1
|
||||||
|
break
|
||||||
|
else :
|
||||||
|
last_time = stime
|
||||||
|
|
||||||
|
if 1 : # now really PARSE the line :
|
||||||
|
try:
|
||||||
|
size=llong(size)
|
||||||
|
except ValueError:
|
||||||
|
raise ValueError("INCORRECT size \"%s\" at line %d : %s " % (size, lineN, line) )
|
||||||
|
|
||||||
|
# Upload :
|
||||||
|
is_exempt=0
|
||||||
|
if isExempt(exempts, src_ip, dst_ip) :
|
||||||
|
is_exempt = 3
|
||||||
|
|
||||||
|
try:
|
||||||
|
conns_DB[src_ip ][is_exempt +1] += size
|
||||||
|
except KeyError:
|
||||||
|
conns_DB[src_ip ] = [long(0)]*6
|
||||||
|
conns_DB[src_ip ][is_exempt +1] = long(size)
|
||||||
|
|
||||||
|
# PURE Upload :
|
||||||
|
is_symmetric = ( prev_src_ip == dst_ip and prev_src_port== dst_port and \
|
||||||
|
prev_dst_ip == src_ip and prev_dst_port== src_port and \
|
||||||
|
prev_stime == stime and prev_proto==proto )
|
||||||
|
if is_symmetric :
|
||||||
|
try :
|
||||||
|
if prev_size > size :
|
||||||
|
conns_DB[prev_src_ip ][ prev_is_exempt + 0] += prev_size
|
||||||
|
else:
|
||||||
|
conns_DB[src_ip ][ is_exempt +0] += size
|
||||||
|
except KeyError:
|
||||||
|
print "proto=%s %s, src_ip=%s %s" % (prev_proto, proto, prev_src_ip, src_ip)
|
||||||
|
else :
|
||||||
|
if prev_is_symmetric == 0 :
|
||||||
|
# previous line has no symetrical transfer, assume PURE upload
|
||||||
|
conns_DB[prev_src_ip ][ prev_is_exempt + 0] += prev_size
|
||||||
|
# Download :
|
||||||
|
#m=lregLAN.search(dst_ip)
|
||||||
|
if 1:
|
||||||
|
dst_is_exempt=0
|
||||||
|
if isExempt(exempts, dst_ip, src_ip) :
|
||||||
|
dst_is_exempt = 3
|
||||||
|
try:
|
||||||
|
conns_DB[dst_ip ][dst_is_exempt +2] += size
|
||||||
|
except KeyError:
|
||||||
|
conns_DB[dst_ip ] = [long(0)]*6
|
||||||
|
conns_DB[dst_ip ][dst_is_exempt +2] = long(size)
|
||||||
|
|
||||||
|
(prev_stime, prev_proto, prev_src_ip, prev_src_port) = (stime, proto, src_ip, src_port)
|
||||||
|
(prev_dst_ip, prev_dst_port, prev_size) = (dst_ip, dst_port, size)
|
||||||
|
(prev_is_exempt, prev_is_symmetric) = (is_exempt, is_symmetric)
|
||||||
|
|
||||||
|
return (nextline, int(last_time), got_nothing)
|
||||||
|
|
||||||
|
def readSlices(inFile, db, exempts, slice0) :
|
||||||
|
"""Loop on time slices, and parse the file step by step"""
|
||||||
|
prevLine=""; last_time=0
|
||||||
|
slice= slice0
|
||||||
|
while 1 : # loop on time_slice
|
||||||
|
end_time = (slice+1) * timeStep
|
||||||
|
u=db[slice]
|
||||||
|
(prevLine, lTime, got_nothing) = parseInputUntil(inFile, prevLine, db [slice], exempts, end_time)
|
||||||
|
if got_nothing :
|
||||||
|
break
|
||||||
|
|
||||||
|
if lTime != 0 : last_time = lTime
|
||||||
|
|
||||||
|
slice = max ( 1+slice, last_time / timeStep)
|
||||||
|
|
||||||
|
if not db.has_key(slice) :
|
||||||
|
db[slice]={}
|
||||||
|
|
||||||
|
return (last_time)
|
||||||
|
|
||||||
|
def readFile(file_info, db, exempts ) :
|
||||||
|
""" reads -completely, partially, or not at all- a list of rotated files.
|
||||||
|
1/ find the file in the list that is the first that contains new data
|
||||||
|
2/ seek the position where we stopped and read the file, and the newer ones.
|
||||||
|
|
||||||
|
file_info fields used here :
|
||||||
|
['fnames'] : list of the rotated-files for one log, e.g. ['net-acct.log', 'net-acct.log.0']
|
||||||
|
must be in anti-chronological order (else the script aborts)
|
||||||
|
['prev_pos'] : offset-position pointig where we stopped reading at previous call
|
||||||
|
(because of log-rotates, we have to guess for which file this offset is..)
|
||||||
|
['last_time'] : timestamp of the last read entry of this log
|
||||||
|
used to guess which file was opened previously, and which are new.
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
if debug :
|
||||||
|
print "VeryBeg: lasttime = %d" % file_info.get('last_time', 777)
|
||||||
|
|
||||||
|
file_info.setdefault('last_time',0)
|
||||||
|
# 1.
|
||||||
|
# Where did we stop, on the previous execution ?
|
||||||
|
# in the list of files, find which need update => [0, end_of_new[ :
|
||||||
|
times = [0]*len(file_info['fnames'])
|
||||||
|
min_time=0
|
||||||
|
i=-1
|
||||||
|
for name in file_info['fnames'] :
|
||||||
|
i += 1
|
||||||
|
try :
|
||||||
|
inFile=open(name,"rb")
|
||||||
|
s = inFile.readline()
|
||||||
|
inFile.close()
|
||||||
|
except IOError :
|
||||||
|
continue
|
||||||
|
if not s :
|
||||||
|
continue
|
||||||
|
t = int( string.split(s, '\t')[0] )
|
||||||
|
assert t > 1
|
||||||
|
if min_time != 0 : assert t <= min_time
|
||||||
|
min_time = t
|
||||||
|
times[i] = t
|
||||||
|
|
||||||
|
end_of_new=0
|
||||||
|
if file_info['last_time']==0 : # first time we read those files
|
||||||
|
file_info['last_time'] = min_time-1
|
||||||
|
end_of_new = len(times)
|
||||||
|
else : # we have archives about those files, see which files are new/updated
|
||||||
|
for t in times :
|
||||||
|
end_of_new += 1
|
||||||
|
if t <= file_info['last_time'] :
|
||||||
|
break # the ones before are old ones. this is last updated one.
|
||||||
|
|
||||||
|
FileNames=file_info['fnames'][0:end_of_new]
|
||||||
|
|
||||||
|
if debug :
|
||||||
|
print "first data at %s(%d), fileTimes= %s" % \
|
||||||
|
(time.asctime(time.localtime(file_info['last_time'])),
|
||||||
|
file_info['last_time'], times)
|
||||||
|
print "We need to read/update %s" % (FileNames)
|
||||||
|
|
||||||
|
if file_info['last_time'] < min_time :
|
||||||
|
file_info['prev_pos'] = 0
|
||||||
|
if file_info.get('reset_if_new', 0) :
|
||||||
|
# erase counters, they are no longer wanted.
|
||||||
|
for k in db.keys() :
|
||||||
|
del db[k]
|
||||||
|
|
||||||
|
slice0= file_info['last_time'] / timeStep
|
||||||
|
|
||||||
|
# 2.
|
||||||
|
# everything's ready, loop on files, and parse them.
|
||||||
|
FileNames.reverse() # start with the oldest
|
||||||
|
times=times[0:end_of_new]
|
||||||
|
Files_and_pos= zip( FileNames, [file_info['prev_pos']] + [0]*(end_of_new-1) )
|
||||||
|
last_time=0; last_pos =0
|
||||||
|
i=len(FileNames)
|
||||||
|
for (fname, pos) in Files_and_pos :
|
||||||
|
i -= 1
|
||||||
|
if debug :
|
||||||
|
print " read %s => Seek to pos %d" % (fname, pos )
|
||||||
|
|
||||||
|
try: inFile = open(fname, "rb")
|
||||||
|
except IOError:
|
||||||
|
continue
|
||||||
|
inFile.seek(pos)
|
||||||
|
|
||||||
|
db.setdefault(slice0, {} )
|
||||||
|
last_time = readSlices(inFile, db, exempts, slice0)
|
||||||
|
if last_time != 0 : # we advanced in this file.
|
||||||
|
slice0= last_time / timeStep
|
||||||
|
elif i>= 1 : # guess an adequate slice0 to start with for next file :
|
||||||
|
slice0= times[i-1]/timeStep
|
||||||
|
last_pos = inFile.tell()
|
||||||
|
assert last_pos >= pos
|
||||||
|
inFile.close()
|
||||||
|
|
||||||
|
# 3.
|
||||||
|
# Update file_info variables :
|
||||||
|
if 1:
|
||||||
|
if last_time != 0 :
|
||||||
|
assert file_info.get('last_time', 0) <= last_time
|
||||||
|
file_info['last_time'] = last_time
|
||||||
|
if last_pos > 0 :
|
||||||
|
file_info['prev_pos'] = last_pos
|
||||||
|
|
||||||
|
if debug and file_info.has_key('last_time') :
|
||||||
|
print "VeryLast: lasttime = %d" % file_info['last_time']
|
||||||
|
|
||||||
|
|
||||||
|
def loadPersist() :
|
||||||
|
data = {}
|
||||||
|
try:
|
||||||
|
data = cPickle.load( open(pickleName, "rb") )
|
||||||
|
except IOError:
|
||||||
|
print "[can not load persistent data. Will need to read all the log-file.]"
|
||||||
|
return data
|
||||||
|
|
||||||
|
def updateData() :
|
||||||
|
""" structure of data :
|
||||||
|
data['counts'] : the actual counters, split in separate databases :
|
||||||
|
['dump'] : for bytes read in the dump
|
||||||
|
['log'] : for bytes read in the log
|
||||||
|
each is a 'conns_DB', that holds one database per timeslice :
|
||||||
|
[<slice>] [IP] : 6-uple (see parseInputUntil)
|
||||||
|
data['files']
|
||||||
|
['ledump'] : is the file_info for the dump files.
|
||||||
|
['lelog' ] : is the file_info for the regular log files
|
||||||
|
each 'file_info' DB has following keys :
|
||||||
|
'fnames', 'prev_pos', 'last_time' (see readFile)
|
||||||
|
'dbName' (the corresponding key into data['counts'])
|
||||||
|
'reset_if_new' (optionnal, designed for the dump file)
|
||||||
|
"""
|
||||||
|
data = loadPersist()
|
||||||
|
|
||||||
|
try:
|
||||||
|
exempts = cPickle.load( open(pickleExemptsName, "rb") )
|
||||||
|
except IOError:
|
||||||
|
print "[can not load exmpts data. assuming no exempt]"
|
||||||
|
exempts = { 'dst' : [], 'src_dst' : {} }
|
||||||
|
|
||||||
|
# initialise each database if needed :
|
||||||
|
for k in ['files', 'counts' ]:
|
||||||
|
data.setdefault(k, {} )
|
||||||
|
Files=data['files']
|
||||||
|
Files.setdefault('ledump', { 'dbName':'dump', 'fnames': dumpFNames, 'reset_if_new':1 })
|
||||||
|
Files.setdefault('lelog', {'dbName':'log', 'fnames': logFNames } )
|
||||||
|
|
||||||
|
# overwrite the filenames stored in pickle with those from the command-line.
|
||||||
|
Files['ledump'] ['fnames'] = dumpFNames
|
||||||
|
Files['lelog'] ['fnames'] = logFNames
|
||||||
|
|
||||||
|
|
||||||
|
for k in Files.keys():
|
||||||
|
data['counts'].setdefault(Files[k]['dbName'], {} )
|
||||||
|
|
||||||
|
for key in data['files'].keys() :
|
||||||
|
file_info = data['files'][key]
|
||||||
|
if debug:
|
||||||
|
print "file_info : %s " % file_info
|
||||||
|
print "Parsing %s into data['counts'][ %s ]" % ( file_info['fnames'], file_info['dbName'])
|
||||||
|
readFile( file_info, data['counts'] [file_info['dbName'] ], exempts )
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def printCounters(counts, mkHeaders=0) :
|
||||||
|
unit = 1e3
|
||||||
|
if megas : unit = 1e6
|
||||||
|
if mkHeaders :
|
||||||
|
return "%9s|%9s|%9s | %10s|%9s|%9s" % ('Pure UL ', 'Upload ', 'Download',
|
||||||
|
'Exempt PUL', 'Exempt U', 'Exempt D' )
|
||||||
|
|
||||||
|
s="%9.3f|%9.3f|%9.3f | %9.3f|%9.3f|%9.3f" % (counts[0]/(unit), counts[1]/(unit), counts[2]/(unit),
|
||||||
|
counts[3]/unit, counts[4]/unit, counts[5]/unit)
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
def bilan(DB, dbNames, duree, cur_time, disp_all = 0) :
|
||||||
|
slice0=int( (cur_time-duree) / timeStep )
|
||||||
|
by_host={}
|
||||||
|
Nslices = {}
|
||||||
|
for db_key in dbNames :
|
||||||
|
Nslices[db_key] = 0
|
||||||
|
for slice in DB[db_key].keys() :
|
||||||
|
if slice >= slice0 :
|
||||||
|
Nslices[db_key] += 1
|
||||||
|
for host in DB[db_key][slice].keys() :
|
||||||
|
if disp_all or regLAN.search(host):
|
||||||
|
counts=DB[db_key][slice][host]
|
||||||
|
cur = by_host.setdefault(host, [long(0)] *len(counts) + [host] )
|
||||||
|
for i in range(len(counts)):
|
||||||
|
cur[i] += counts[i]
|
||||||
|
liste=by_host.values()
|
||||||
|
liste.sort( lambda x, y: -cmp(x[sort_column], y[sort_column] )) # tri décroissant sur le N° champ
|
||||||
|
print " %5.1f h stats since %s. %d hour-slices found " % (duree/3600.0,
|
||||||
|
time.asctime(time.localtime(slice0*timeStep)),
|
||||||
|
max(Nslices.values()) )
|
||||||
|
print printCounters(0, 1) + " | HOST"
|
||||||
|
print "="*77
|
||||||
|
for l in liste[0:top10_length] :
|
||||||
|
# Test si le DNS de la machine existe (donc si la machine est inscrite au crans)
|
||||||
|
try:
|
||||||
|
host = socket.gethostbyaddr( l[-1] ) [0]
|
||||||
|
bad = 0
|
||||||
|
except socket.error :
|
||||||
|
host = l[-1]
|
||||||
|
bad = 1
|
||||||
|
|
||||||
|
if not resolve_names :
|
||||||
|
# On veut l'IP
|
||||||
|
host = l[-1]
|
||||||
|
|
||||||
|
if bad :
|
||||||
|
host = "NoDNS_" + host
|
||||||
|
|
||||||
|
print printCounters(l)+ (" |%s" % host)
|
||||||
|
|
||||||
|
|
||||||
|
def detail_bilan(DB, hostName, IP, duree, cur_time) :
|
||||||
|
slice0 = int( (cur_time-duree) / timeStep )
|
||||||
|
slice1 = slice0 + int( duree/timeStep)
|
||||||
|
slicePrints={}
|
||||||
|
Nslices = {}
|
||||||
|
db_key = 'log'
|
||||||
|
|
||||||
|
Nslices[db_key] = 0
|
||||||
|
for slice in range(slice0, slice1+1) :
|
||||||
|
pref = time.strftime("%Hh%M", time.localtime(slice*timeStep) )
|
||||||
|
str = " (No record of this time-slice at all)"
|
||||||
|
if slice in DB[db_key].keys() :
|
||||||
|
str = " (No activity for this host in this time-slice)"
|
||||||
|
Nslices[db_key] += 1
|
||||||
|
if IP in DB[db_key][slice].keys() :
|
||||||
|
str = printCounters( DB[db_key][slice][IP])
|
||||||
|
|
||||||
|
slicePrints[slice] = "%s|%s" %(pref,str)
|
||||||
|
|
||||||
|
print "Comptes par tranches de %ds pour la machine %s" % (timeStep, hostName)
|
||||||
|
print "début : %s" % (time.asctime(time.localtime( slice0 * timeStep) ) )
|
||||||
|
print ("%5s|" % 'time') + printCounters(0,1)
|
||||||
|
print "="*77
|
||||||
|
for slice in range(slice0, slice1+1) :
|
||||||
|
l=slicePrints[slice]
|
||||||
|
print l
|
||||||
|
print "Fin : %s" % (time.asctime(time.localtime( -1 + (slice1+1) * timeStep) ) )
|
||||||
|
|
||||||
|
|
||||||
|
def main(cur_time) :
|
||||||
|
data=updateData()
|
||||||
|
bilan(data['counts'], ['log', 'dump'], duree, cur_time, disp_all)
|
||||||
|
|
||||||
|
# make persistent data as small as possible :
|
||||||
|
del data['counts'][ data['files']['ledump']['dbName'] ]
|
||||||
|
del data['files']['ledump']
|
||||||
|
cur_t = time.time()
|
||||||
|
del_slices=[]
|
||||||
|
# -> get rid of old slices
|
||||||
|
for slice in data['counts']['log'].keys() :
|
||||||
|
if slice < (cur_t-sduree)/timeStep :
|
||||||
|
del_slices.append(slice)
|
||||||
|
for slice in del_slices :
|
||||||
|
del data['counts']['log'][slice]
|
||||||
|
|
||||||
|
# get rid of useless extern hosts :
|
||||||
|
|
||||||
|
for slice in data['counts']['log'].keys() :
|
||||||
|
d=data['counts']['log'][slice]
|
||||||
|
del_hosts=[]
|
||||||
|
for host in d.keys() :
|
||||||
|
m= store_all or regLAN.search(host)
|
||||||
|
# keep extern hosts that were used as big upload targets : download >= 1 Mo
|
||||||
|
if not m and d[host][2]< 1e6 :
|
||||||
|
del_hosts.append( host)
|
||||||
|
for host in del_hosts :
|
||||||
|
del d[host]
|
||||||
|
|
||||||
|
cPickle.dump(data, open(pickleName,"wb") )
|
||||||
|
|
||||||
|
|
||||||
|
#################
|
||||||
|
# global vars :
|
||||||
|
#
|
||||||
|
|
||||||
|
timeStep=3600 # 1h slices
|
||||||
|
#################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
optlist, args = getopt.getopt(sys.argv[1:], "dkDsnc:p:f:h::u:L:N:T:t:")
|
||||||
|
|
||||||
|
lock_name = "/var/lock/nacct.py" # Fichier de lock
|
||||||
|
store_all = 0 # if false, store only hosts matching regLAN
|
||||||
|
disp_all = 0 # if false, display only .. ..
|
||||||
|
sduree = 48*3600 # delete slices when they are that much old
|
||||||
|
duree = 0 # display the stats over this period
|
||||||
|
top10_length = 30
|
||||||
|
sort_column= 0 # 0 : sort by PURE, 1 : by upload, 2: by download.. up to 6 (cf parseInputUntil)
|
||||||
|
resolve_names = 1 # resolve hostnames
|
||||||
|
logFNames= []
|
||||||
|
dumpFNames=[]
|
||||||
|
debug=0
|
||||||
|
megas=1
|
||||||
|
detail_host=""
|
||||||
|
cur_time=time.time()
|
||||||
|
network=""
|
||||||
|
pickleName=""
|
||||||
|
pickleExemptsName = ""
|
||||||
|
|
||||||
|
if os.path.isfile(lock_name) :
|
||||||
|
# Ya le lock
|
||||||
|
print "Lock existant (%s)" % lock_name
|
||||||
|
fd = open(lock_name, "r")
|
||||||
|
msg=fd.readlines()
|
||||||
|
fd.close()
|
||||||
|
pid=string.split(msg[0],'\n')[0]
|
||||||
|
msg=string.strip(string.join(msg[1:], '') )
|
||||||
|
q = os.system("ps -o pid,tty,user,etime,command " +pid)
|
||||||
|
if q==256:
|
||||||
|
print "PID lock no trouvé => delock"
|
||||||
|
try :
|
||||||
|
os.remove(lock_name)
|
||||||
|
except :
|
||||||
|
None
|
||||||
|
else :
|
||||||
|
print "Script lockant en activité, sortie"
|
||||||
|
sys.exit(255)
|
||||||
|
|
||||||
|
#Locking
|
||||||
|
lock_fd=open(lock_name, "w")
|
||||||
|
lock_comment = "%s" % os.getpid()
|
||||||
|
lock_fd.write(lock_comment)
|
||||||
|
lock_fd.close()
|
||||||
|
|
||||||
|
for [key, val] in optlist :
|
||||||
|
if key == '-f' :
|
||||||
|
logFNames.append(val)
|
||||||
|
if key == '-u' :
|
||||||
|
dumpFNames.append(val)
|
||||||
|
if key == '-d' :
|
||||||
|
debug = 1
|
||||||
|
if key == '-D' :
|
||||||
|
disp_all = 1
|
||||||
|
if key == '-L' :
|
||||||
|
network = val
|
||||||
|
if key == '-h' :
|
||||||
|
detail_host = val
|
||||||
|
if key == '-t' :
|
||||||
|
cur_time = int( time.mktime(time.strptime(val,"%Y %m %d %H:%M")) )
|
||||||
|
if key == '-N' :
|
||||||
|
top10_length = int(val)
|
||||||
|
if key == '-k' :
|
||||||
|
megas = 0 # use kilos instead of Megs
|
||||||
|
if key == '-p' :
|
||||||
|
pickleName=val
|
||||||
|
if key == '-s' :
|
||||||
|
store_all = 1
|
||||||
|
if key == '-n' :
|
||||||
|
resolve_names = 0
|
||||||
|
if key == '-T' :
|
||||||
|
if duree == 0 :
|
||||||
|
duree = int( float(val) * 3600 )
|
||||||
|
else:
|
||||||
|
sduree = int( float(val) * 3600 * 24 )
|
||||||
|
if key == '-c' :
|
||||||
|
sort_column = int(val) -1
|
||||||
|
|
||||||
|
if duree == 0:
|
||||||
|
duree = 24*3600
|
||||||
|
if not logFNames :
|
||||||
|
logFNames = ["/var/log/net-acct/net-acct.log", "/var/log/net-acct/net-acct.log.0" ]
|
||||||
|
if not dumpFNames :
|
||||||
|
dumpFNames = ["/var/log/net-acct/dump" ]
|
||||||
|
if not network :
|
||||||
|
network = "^138\.231\.1((3[6-9]|4[0-9]|50|51).*)$"
|
||||||
|
regLAN=re.compile(network)
|
||||||
|
if not pickleName :
|
||||||
|
pickleName="/tmp/nacct.pickle"
|
||||||
|
|
||||||
|
if not pickleExemptsName :
|
||||||
|
pickleExemptsName="/tmp/exempts.pickle"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# launch :
|
||||||
|
if detail_host :
|
||||||
|
data=loadPersist()
|
||||||
|
IP = socket.gethostbyname( detail_host)
|
||||||
|
detail_bilan(data['counts'], detail_host, IP, duree, cur_time)
|
||||||
|
else :
|
||||||
|
data = main(cur_time)
|
||||||
|
|
||||||
|
# Supression du lock
|
||||||
|
try :
|
||||||
|
os.remove(lock_name)
|
||||||
|
except :
|
||||||
|
None
|
||||||
|
|
29
archive/archives/analyse_komaz/rpc_scan.awk
Executable file
29
archive/archives/analyse_komaz/rpc_scan.awk
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/awk -f
|
||||||
|
#Lecture des logs du firewall pour retourner la liste des machines attaquant
|
||||||
|
#sur le port 135 ou 6667
|
||||||
|
#
|
||||||
|
#Arguments :
|
||||||
|
#<fichier(s) à scanner> <autre fichier donc le nom contient blacklist>
|
||||||
|
# Le second fichier contient les IP des machines supplémentaires à sortir.
|
||||||
|
#
|
||||||
|
# Format de sortie : Mois jour hh:mm:ss hostname nb_attques
|
||||||
|
#
|
||||||
|
# 02/2003 Frédéric Pauget
|
||||||
|
|
||||||
|
{ if (FILENAME~"blacklist") {
|
||||||
|
if ($0=="") nextfile;
|
||||||
|
tentatives[$0]=0;
|
||||||
|
dern_tentative[$0]="Vieux 00 00:00:00"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/.*Virus:IN=eth0.*/{
|
||||||
|
gsub("SRC=","",$9);
|
||||||
|
tentatives[$9]++;
|
||||||
|
dern_tentative[$9]=$1" "$2" "$3;
|
||||||
|
}
|
||||||
|
|
||||||
|
END{
|
||||||
|
for (machine in tentatives){
|
||||||
|
system("echo "dern_tentative[machine]" $(host "machine" 2>/dev/null | awk '/^Name/ {print $2}') "tentatives[machine])
|
||||||
|
}
|
||||||
|
}
|
240
archive/archives/analyse_komaz/virus_scan.sh
Executable file
240
archive/archives/analyse_komaz/virus_scan.sh
Executable file
|
@ -0,0 +1,240 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#############################################################################
|
||||||
|
## Script de déconexion/reconnexion automatique pour virus de type blaster ##
|
||||||
|
## ##
|
||||||
|
## Principe : ##
|
||||||
|
## -> détection des attaques grâce aux logs du firewall ##
|
||||||
|
## lecture par *_scan.awk ##
|
||||||
|
## -> à partir du nombre d'attaques et de l'heure de dernière attaque ##
|
||||||
|
## déconnecte ou reconnecte des machines ##
|
||||||
|
## ##
|
||||||
|
## Frédéric Pauget 02/2003 ##
|
||||||
|
## 07/2004 adaptation pour scan de plusieurs types d'attaques ##
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
is_up() {
|
||||||
|
# Supression de la machine dans la table arp
|
||||||
|
/usr/sbin/arp -d $1 2> /dev/null
|
||||||
|
|
||||||
|
# Teste si la machine founie est up
|
||||||
|
if fping -c1 $1 > /dev/null 2>&1 ; then
|
||||||
|
# Elle a répondu au ping
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
if /usr/sbin/arp $1 2>/dev/null | egrep -q '(no entry|incomplete)' ; then
|
||||||
|
# Elle n'est pas dans la table ARP
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
# Elle est dans la table ARP
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [[ $1 ]] && [[ $1 = "--real-run" ]]; then
|
||||||
|
dry=false
|
||||||
|
else
|
||||||
|
dry=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
BLACKLIST_FINAL='/tmp/virus_blacklist'
|
||||||
|
|
||||||
|
# Logs du firewall
|
||||||
|
FW_LOGS=/var/log/firewall/filtre.log
|
||||||
|
|
||||||
|
# Prétraitement logs
|
||||||
|
tail -7200 $FW_LOGS > /tmp/fw_logs_light
|
||||||
|
|
||||||
|
# Fonction utile : retourne l'IP d'une machine
|
||||||
|
ip() {
|
||||||
|
echo $(host $1 2>/dev/null | awk '{print $3}')
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fonction principale
|
||||||
|
scan() {
|
||||||
|
# signification des arguments :
|
||||||
|
# 1 : nombre d'attaques pour être considéré infecté
|
||||||
|
# 2 : nombre de secondes sans attaques pour être considéré sain
|
||||||
|
# 3 : script de scan
|
||||||
|
# 4 : repertoire de stockage fichiers
|
||||||
|
nb_att=$1
|
||||||
|
nb_sec=$2
|
||||||
|
SCRIPT=$3
|
||||||
|
|
||||||
|
# Liste des attaques
|
||||||
|
INFECTES=$4/infectes
|
||||||
|
# Machines décontaminées
|
||||||
|
RECO=$4/reconectes
|
||||||
|
|
||||||
|
# Machines blacklistées
|
||||||
|
BLACKLIST=$4/blacklist
|
||||||
|
|
||||||
|
# Fichiers temporaires supplémentaires
|
||||||
|
DIFF=/tmp/virus_diff
|
||||||
|
TMPFILE=/tmp/virus_scan
|
||||||
|
|
||||||
|
# Doit exister, même vides
|
||||||
|
touch $RECO
|
||||||
|
touch $BLACKLIST
|
||||||
|
|
||||||
|
if ! [[ -e $INFECTES ]]; then
|
||||||
|
dry=true
|
||||||
|
echo "dry-run mode forcé (fichier absent)"
|
||||||
|
touch $INFECTES
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test préliminaire
|
||||||
|
if [[ ! -e $SCRIPT ]] ; then
|
||||||
|
echo "Erreur : $SCRIPT non trouvé"
|
||||||
|
exit 255
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Conversion blacklist hostname -> IPs
|
||||||
|
if [[ "$(head -1 $BLACKLIST)" == "komaz" ]]; then
|
||||||
|
echo "Ancienne blackliste vide"
|
||||||
|
touch $BLACKLIST.ip
|
||||||
|
else
|
||||||
|
echo "Conversion blackliste..."
|
||||||
|
for i in $(cat $BLACKLIST | sort | uniq)
|
||||||
|
do
|
||||||
|
ip $i
|
||||||
|
done > $BLACKLIST.ip
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Détection des infectés..."
|
||||||
|
$SCRIPT $BLACKLIST.ip /tmp/fw_logs_light > $TMPFILE
|
||||||
|
# sort un fichier du type :
|
||||||
|
# Mois Jour Heure hostname nb d'attaques depuis les dernier logrotate
|
||||||
|
|
||||||
|
echo "Traitement..."
|
||||||
|
mv $INFECTES $INFECTES.old
|
||||||
|
sort -r $TMPFILE > $INFECTES
|
||||||
|
echo -n "" > $TMPFILE
|
||||||
|
|
||||||
|
# Différencee entre le fichier obtenu la au dernier lancement et le nouveau
|
||||||
|
diff -U 1000 $INFECTES.old $INFECTES | egrep -v '\-\-\-|\+\+\+|@@' > $DIFF
|
||||||
|
|
||||||
|
if ! [[ -s $DIFF ]]; then
|
||||||
|
echo "Aucun changement par rapport au dernier scan."
|
||||||
|
cp $INFECTES $DIFF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Traitement par host
|
||||||
|
for host in $(awk '{print $4}' $DIFF | sort | uniq)
|
||||||
|
do
|
||||||
|
if grep -q "\+.* $host " $DIFF && grep -q "\-.* $host " $DIFF ; then
|
||||||
|
# En + et - : variation
|
||||||
|
nb=$(echo $(awk '$4=="'$host'" {print $5}' $INFECTES) - $(awk '$4=="'$host'" {print $5}' $INFECTES.old) | bc)
|
||||||
|
echo -ne "Variation ($nb) "
|
||||||
|
if grep -q "^$host$" $BLACKLIST ; then
|
||||||
|
# Déja blacklisté, on remet
|
||||||
|
echo -ne "\033[1;31m(RESTE) "
|
||||||
|
echo $host >> $TMPFILE
|
||||||
|
elif [[ $nb -gt $nb_att ]] ; then
|
||||||
|
# Nouveau
|
||||||
|
echo -ne "\033[1;31m(NOUVEAU) "
|
||||||
|
echo $host >> $TMPFILE
|
||||||
|
else
|
||||||
|
# Pas assez de tentatives
|
||||||
|
echo -n "(PASSE) "
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
elif grep -q "\+.* $host " $DIFF ; then
|
||||||
|
# Que en + donc c'est un nouveau
|
||||||
|
nb=$(awk '$4=="'$host'" {print $5}' $INFECTES)
|
||||||
|
if [[ $nb -gt $nb_att ]] ; then
|
||||||
|
echo -ne "\033[1;31mNOUVEAU ($nb) "
|
||||||
|
echo $host >> $TMPFILE
|
||||||
|
else
|
||||||
|
echo -ne "PASSE ($nb) "
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif grep -q "\-.* $host " $DIFF ; then
|
||||||
|
# Que en -, c'est un coup de logrotate, on remet les blacklistés.
|
||||||
|
if grep -q "^$host$" $BLACKLIST ; then
|
||||||
|
echo "RESTE : $host"
|
||||||
|
echo $host >> $TMPFILE
|
||||||
|
else
|
||||||
|
echo "Vieux : $host"
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
# Pas de variation
|
||||||
|
if grep -q "^$host$" $BLACKLIST ; then
|
||||||
|
echo -n "Pas de variation "
|
||||||
|
# UP or not ?
|
||||||
|
if is_up $host ; then
|
||||||
|
# UP
|
||||||
|
last=$(date -d "$(awk '$4=="'$host'" {print $1" "$2" "$3}' $INFECTES)" +%s 2>/dev/null)
|
||||||
|
# Cas ou c'est vraiment trop vieux
|
||||||
|
if [[ -z $last ]] ; then
|
||||||
|
last=0
|
||||||
|
fi
|
||||||
|
now=$(date +%s)
|
||||||
|
t=$(echo "$now-$last" | bc)
|
||||||
|
if [[ $t -gt $nb_sec ]] ; then
|
||||||
|
# Reconexions automatique
|
||||||
|
echo -n " reconnexion"
|
||||||
|
echo $host >> $RECO
|
||||||
|
else
|
||||||
|
echo $host >> $TMPFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
# Down
|
||||||
|
echo -ne "\033[1;41m(NO_PING)"
|
||||||
|
echo $host >> $TMPFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -ne "\033[0m : "
|
||||||
|
else
|
||||||
|
echo -n "Reste connecté "
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo -ne "\033[0m"
|
||||||
|
awk '$4=="'$host'" {print $1" "$2" "$3" "$4}' $INFECTES
|
||||||
|
done
|
||||||
|
|
||||||
|
# Opérations finales
|
||||||
|
sort $TMPFILE > $BLACKLIST
|
||||||
|
}
|
||||||
|
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
# Scan des attaques sur le 135 :
|
||||||
|
# 10 tentatives pour être considéré infecté
|
||||||
|
# 1h sans attaque pour être considéré désinfecté
|
||||||
|
echo -e "\033[1;33m###############################\nScan attaques port 135 ou 6667\033[1;0m"
|
||||||
|
scan 10 3600 /usr/scripts/analyse_komaz/rpc_scan.awk /var/tmp/rpc
|
||||||
|
|
||||||
|
# Scan des floods :
|
||||||
|
# 100 tentatives pour être considéré infecté
|
||||||
|
# 1h sans attaque pour être considéré désinfecté
|
||||||
|
echo -e "\033[1;33m###############################\nScan floods\033[1;0m"
|
||||||
|
scan 100 3600 /usr/scripts/analyse_komaz/flood_scan.awk /var/tmp/flood
|
||||||
|
|
||||||
|
# Constitution de la blackliste finale
|
||||||
|
cat /var/tmp/rpc/blacklist /var/tmp/flood/blacklist | sort | uniq > $BLACKLIST_FINAL.new
|
||||||
|
|
||||||
|
if ! [[ -s $BLACKLIST_FINAL.new ]]; then
|
||||||
|
# Il n'y a personne, il faut au moins une machine sinon squid aime pas.
|
||||||
|
echo 'komaz' > $BLACKLIST_FINAL.new
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! $dry ; then
|
||||||
|
if diff -q $BLACKLIST_FINAL $BLACKLIST_FINAL.new ; then
|
||||||
|
echo "Pas de changement dans la blackliste"
|
||||||
|
else
|
||||||
|
# Synchro blacklist
|
||||||
|
/usr/bin/rsync -C -a -e "ssh -i /usr/scripts/analyse_komaz/keys/synchro_virus" $BLACKLIST_FINAL.new root@sila.crans.org:/etc/squid/blacklist_infectes
|
||||||
|
# Reload de squid
|
||||||
|
/usr/bin/ssh -o StrictHostKeyChecking=no -i /usr/scripts/analyse_komaz/keys/reload_squid root@sila.crans.org squid reload
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Dry mode : blackliste non copiée sur sila et squid non relancé"
|
||||||
|
echo "Utiliser l'option --real-run pour tout faire."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# On ne garde que la dernière version de la blacklist
|
||||||
|
mv $BLACKLIST_FINAL.new $BLACKLIST_FINAL
|
93
archive/archives/arpanoid
Executable file
93
archive/archives/arpanoid
Executable file
|
@ -0,0 +1,93 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# Dis, emacs, c'est du -*- python -*-, ça !
|
||||||
|
#
|
||||||
|
# C.Chépélov, 19 janvier 1999. Suite à discussion avec Olivier DALOY, et
|
||||||
|
# des trucs louches dans ses logs. Merci, merci ARP !!
|
||||||
|
|
||||||
|
import config
|
||||||
|
import pickle,string,os
|
||||||
|
|
||||||
|
# Phase 1 : lire les données théoriques, les retrier pour être exploitables.
|
||||||
|
|
||||||
|
ZONEDB = pickle.load(open(config.CFG_FILE_ROOT+"Zone.db","r"))
|
||||||
|
|
||||||
|
THicn_by_mac = {} # ip, comment, name by MAC (théorique)
|
||||||
|
THncm_by_ip = {} # name, comment, MAC by IP (théorique)
|
||||||
|
|
||||||
|
for name in ZONEDB.keys():
|
||||||
|
(IP,comment,MAC) = ZONEDB[name]
|
||||||
|
THicn_by_mac[MAC] = (IP,comment,name)
|
||||||
|
THncm_by_ip[IP] = (name,comment,MAC)
|
||||||
|
|
||||||
|
# Phase 2 : Lire les données réelles, les mettres dans des dicos pour être
|
||||||
|
# exploitables.
|
||||||
|
|
||||||
|
arp = os.popen("arp -n","r")
|
||||||
|
arp.readline()
|
||||||
|
|
||||||
|
ip_by_mac = {}
|
||||||
|
mac_by_ip = {}
|
||||||
|
while 1:
|
||||||
|
s = arp.readline()
|
||||||
|
if not s: break
|
||||||
|
sl = string.split(s)
|
||||||
|
try:
|
||||||
|
ip = sl[0]
|
||||||
|
|
||||||
|
mac = ""
|
||||||
|
if (sl[1] != "ether") or (sl[2] == "(incomplete)"): raise "incomplete"
|
||||||
|
for c in string.lower(sl[2]):
|
||||||
|
if c in "0123456789abcdef":
|
||||||
|
mac = mac + c
|
||||||
|
if not ip or not mac: break
|
||||||
|
ip_by_mac[mac] = ip
|
||||||
|
mac_by_ip[ip] = mac
|
||||||
|
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Phase 3 : en fonction des gens qu'on a vus, faire une comparaison...
|
||||||
|
# d'abord, par IP vues :
|
||||||
|
|
||||||
|
try:
|
||||||
|
problems = open("/var/log/arpanoid","r").readlines()
|
||||||
|
except:
|
||||||
|
problems = []
|
||||||
|
# la liste des problèmes. Sera triée par ordre alphabétique
|
||||||
|
# et les problèmes rendus uniques.
|
||||||
|
# note: on récupère les vieux problèmes, on génèrera le même message
|
||||||
|
# plusieurs fois (pas grave, on virera les messages identiques)
|
||||||
|
|
||||||
|
def log(s):
|
||||||
|
s = s + '\n'
|
||||||
|
if not s in problems: problems.append(s)
|
||||||
|
|
||||||
|
for ip,mac in mac_by_ip.items():
|
||||||
|
|
||||||
|
if THicn_by_mac.has_key(mac):
|
||||||
|
thIP,comment,name = THicn_by_mac[mac]
|
||||||
|
if thIP == ip: pass # print name,' est clair (IP by MAC)'
|
||||||
|
else:
|
||||||
|
if THncm_by_ip.has_key(ip): victim,t1,t2 = THncm_by_ip[ip]
|
||||||
|
else: victim = "(inconnu)"
|
||||||
|
log("%s (%s) usurpe une adresse IP !!! (normal=%s,actuel=%s[%s])" % (name,comment,thIP,ip,victim))
|
||||||
|
else:
|
||||||
|
log("MACHINE INCONNUE (intruse ?) MAC=%s !" % mac)
|
||||||
|
|
||||||
|
if THncm_by_ip.has_key(ip):
|
||||||
|
name,comment,thMAC = THncm_by_ip[ip]
|
||||||
|
if thMAC == mac: pass # print name,' est clair (MAC by IP)'
|
||||||
|
else:
|
||||||
|
if THicn_by_mac.has_key(mac): t1,t2,name = THicn_by_mac[mac]
|
||||||
|
else: victim = "(inconnu)"
|
||||||
|
log("%s (%s) utilise une autre carte réseau !!! (normal=%s,actuel=%s[%s]" % (name,comment,thMAC,mac,victim))
|
||||||
|
else:
|
||||||
|
diag = "(intruse ?)"
|
||||||
|
if THicn_by_mac.has_key(mac):
|
||||||
|
THip,comment,name = THicn_by_mac[mac]
|
||||||
|
diag = "%s de %s" % (name,comment)
|
||||||
|
log("MACHINE AVEC FAUX IP=%s (%s)!" % (ip,diag))
|
||||||
|
problems.sort()
|
||||||
|
|
||||||
|
print string.join(problems,"")
|
||||||
|
|
17
archive/archives/arpanoid-daily
Executable file
17
archive/archives/arpanoid-daily
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
subject="logs ARPanoid `date` "
|
||||||
|
dest="root@crans.ens-cachan.fr"
|
||||||
|
|
||||||
|
cat <<Fini | cat - /var/log/arpanoid | mail -s "$subject" $dest
|
||||||
|
|
||||||
|
Résultats de la chasse "ARPanoid" de la journée :
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
Fini
|
||||||
|
|
||||||
|
mv -f /var/log/arpanoid /var/log/arpanoid.bak
|
||||||
|
touch /var/log/arpanoid
|
||||||
|
chmod 640 /var/log/arpanoid
|
||||||
|
chown root:admin /var/log/arpanoid
|
||||||
|
/etc/CRANS/code/arpanoid > /var/log/arpanoid 2>/dev/null
|
2
archive/archives/arpanoid-frequently
Executable file
2
archive/archives/arpanoid-frequently
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
/etc/CRANS/code/arpanoid > /var/log/arpanoid 2>/dev/null
|
21
archive/archives/auto-claque
Executable file
21
archive/archives/auto-claque
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# CC 2/2/1999 horrible kludge
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Pour des raisons bizarres (bug driver SMC ? matériel ?), les interfaces
|
||||||
|
# eth1 et eth2 bloquent régulièrement.
|
||||||
|
# en général, un claquage suffit à les relancer. Par ailleurs, un claquage
|
||||||
|
# ne bloque pas les communications -- on peut donc jouer à le faire
|
||||||
|
# régulièrement.
|
||||||
|
#
|
||||||
|
|
||||||
|
#a enlever les commentaires! 19.02
|
||||||
|
# 20/01/2000 jerome reactive le script
|
||||||
|
|
||||||
|
echo "Claquage des interfaces" | /usr/bin/logger -t "AutoClaque" -p user.warn
|
||||||
|
|
||||||
|
ifconfig eth0 down; ifconfig eth0 up; route add default gw 138.231.136.2
|
||||||
|
|
||||||
|
ifconfig eth1 down; ifconfig eth1 up
|
||||||
|
ifconfig eth2 down; ifconfig eth2 up 138.231.137.2 netmask 255.255.255.0 broadcast 138.231.137.255
|
||||||
|
ifconfig eth3 down; ifconfig eth3 up
|
186
archive/archives/beastie.c
Normal file
186
archive/archives/beastie.c
Normal file
|
@ -0,0 +1,186 @@
|
||||||
|
/*
|
||||||
|
* Un faux daemon.
|
||||||
|
*
|
||||||
|
* Copyright (c) 1999 Association CRANS.
|
||||||
|
*
|
||||||
|
* Auteur: Olivier Saut <Olivier.Saut@crans.ens-cachan.fr>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include <syslog.h>
|
||||||
|
#include <varargs.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
|
||||||
|
#ifndef LINUX
|
||||||
|
#include <libutil.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define kZamok_Tourne 1
|
||||||
|
#define kPORT 514 /* Port de rshd */
|
||||||
|
#define kMaxDaemonChildren 10
|
||||||
|
|
||||||
|
int nbrFils;
|
||||||
|
|
||||||
|
|
||||||
|
int daemon_init(void) {
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
|
if((pid = fork())<0)
|
||||||
|
return (-1);
|
||||||
|
else if (pid !=0) {
|
||||||
|
(void)fprintf(stdout,"beastie launched : %d\n",pid);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
setsid();
|
||||||
|
chdir("/");
|
||||||
|
umask(0);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Attention subtil (waitpid plutot que wait) :-) */
|
||||||
|
void zombie(int signo) {
|
||||||
|
pid_t pid;
|
||||||
|
int stat;
|
||||||
|
|
||||||
|
while ((pid = waitpid(-1, &stat, WNOHANG)) > 0)
|
||||||
|
nbrFils--;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sigterm(int signo) {
|
||||||
|
syslog(LOG_NOTICE,"beastie killed by SIGTERM.");
|
||||||
|
closelog();
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]){
|
||||||
|
int serv_sock, client_sock, cli_len;
|
||||||
|
struct sockaddr_in serv_addr, cli_addr;
|
||||||
|
struct hostent *cli_ent;
|
||||||
|
char *clientname,*message;
|
||||||
|
int PORT;
|
||||||
|
pid_t pid;
|
||||||
|
sig_t previous_handler;
|
||||||
|
char buffer[1024];
|
||||||
|
|
||||||
|
if(argc>1)
|
||||||
|
PORT=atoi(argv[1]);
|
||||||
|
else
|
||||||
|
PORT=kPORT;
|
||||||
|
|
||||||
|
if(setuid(getuid())) {
|
||||||
|
perror("Setuid.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* On se daemonize */
|
||||||
|
if(daemon_init()) {
|
||||||
|
perror("Initialize as daemon.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pour éviter les zombies (vade retro...) */
|
||||||
|
previous_handler = signal(SIGCHLD,(sig_t)zombie);
|
||||||
|
if(previous_handler==SIG_ERR) {
|
||||||
|
perror("Installing SIGCHLD handler");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pour détecter le SIGTERM */
|
||||||
|
previous_handler = signal(SIGTERM,(sig_t)sigterm);
|
||||||
|
if(previous_handler==SIG_ERR) {
|
||||||
|
perror("Installing SIGTERM handler");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
nbrFils=0;
|
||||||
|
|
||||||
|
#ifndef LINUX
|
||||||
|
setproctitle("ecoute le port %d",PORT);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
openlog("beastie", LOG_PID|LOG_CONS,LOG_LOCAL2);
|
||||||
|
|
||||||
|
serv_sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
if (serv_sock < 0)
|
||||||
|
{
|
||||||
|
perror("Creating server socket.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* On remplit la structure */
|
||||||
|
bzero((char *) &serv_addr, sizeof (serv_addr));
|
||||||
|
serv_addr.sin_family = AF_INET;
|
||||||
|
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
|
serv_addr.sin_port = htons(PORT);
|
||||||
|
|
||||||
|
/* Et on lie la socket au port */
|
||||||
|
if (bind(serv_sock, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) < 0)
|
||||||
|
{
|
||||||
|
perror("Binding server socket.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
listen(serv_sock,5);
|
||||||
|
|
||||||
|
while(kZamok_Tourne) {
|
||||||
|
|
||||||
|
cli_len = sizeof (cli_addr);
|
||||||
|
bzero((char *) &cli_addr, sizeof (cli_addr));
|
||||||
|
|
||||||
|
client_sock = accept(serv_sock, (struct sockaddr *) &cli_addr, &cli_len);
|
||||||
|
if (client_sock < 0)
|
||||||
|
{
|
||||||
|
perror("Accepting connection on server socket.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* On forke, on traite la requete dans le fils */
|
||||||
|
/* Evaluation paresseuse */
|
||||||
|
if((nbrFils++ < kMaxDaemonChildren) && ((pid=fork())==0) ) {
|
||||||
|
close(serv_sock);
|
||||||
|
clientname=inet_ntoa(cli_addr.sin_addr); /* On recupere le nom */
|
||||||
|
/* Hehe t'es loggue mon pote */
|
||||||
|
if(strcmp(clientname, "127.0.0.1")) {
|
||||||
|
if (!((cli_ent= gethostbyaddr((char *)&cli_addr.sin_addr.s_addr,
|
||||||
|
sizeof (u_long), AF_INET)) == (struct hostent *)0)) {
|
||||||
|
snprintf(buffer,1023, "Tentative de connexion de %s au port %d.",cli_ent->h_name,PORT);
|
||||||
|
syslog(LOG_NOTICE,buffer );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
snprintf(buffer,1023, "Tentative de connexion de %s au port %d.",clientname,PORT);
|
||||||
|
syslog(LOG_NOTICE,buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(client_sock);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
/* Fin du fork */
|
||||||
|
|
||||||
|
close(client_sock);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
closelog();
|
||||||
|
close(serv_sock);
|
||||||
|
exit( 0);
|
||||||
|
}
|
52
archive/archives/cdecode
Executable file
52
archive/archives/cdecode
Executable file
|
@ -0,0 +1,52 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# Dis, emacs, c'est du -*- python -*-
|
||||||
|
#
|
||||||
|
"""
|
||||||
|
Programme fait pour encoder les chambres suivant le cryptage standard
|
||||||
|
pour le bâtiment G (le F peut aussi s'en servir). Inutile au B, il y a déjà un
|
||||||
|
autre mapping (les prises réseau sont numérotées différemment des chambres)
|
||||||
|
|
||||||
|
Ceci ne résistera évidemment pas à une attaque cryptographique en règle.
|
||||||
|
|
||||||
|
L'algorithme étant réellement trivial, il est raisonnable de laisser ce
|
||||||
|
script "chmod 700" et "chown root:root" !
|
||||||
|
|
||||||
|
C.Chepelov 5 novembre 1998 (présente implémentation), mise au point de
|
||||||
|
l'algorithme et première implémentation en Reverse Polish Lisp (HP48) à
|
||||||
|
l'automne 1997.
|
||||||
|
|
||||||
|
Note : l'implémentation de référence est "cencode". L'algo est symétriqe...
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print "usage : %s <numéro de code>" % sys.argv[0]
|
||||||
|
print "exemple : %s 9378 --> 126 " % sys.argv[0]
|
||||||
|
print
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
s_arg = sys.argv[1]
|
||||||
|
try:
|
||||||
|
arg = int(s_arg)
|
||||||
|
if arg >= 10000: raise "pas bon."
|
||||||
|
except:
|
||||||
|
print "L'argument doit être un nombre inférieur à 10000 !"
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
# C'est pas du tout optimal, mais on s'en fout !
|
||||||
|
c1 = int(arg / 100) % 10
|
||||||
|
c2 = int(arg / 10) % 10
|
||||||
|
c3 = arg % 10
|
||||||
|
s = int(arg / 1000) % 10
|
||||||
|
|
||||||
|
f3 = t1 = (10 - c1 + s) % 10
|
||||||
|
f2 = t2 = (10 - c2 + s) % 10
|
||||||
|
f1 = t3 = (10 - c3 + s) % 10
|
||||||
|
|
||||||
|
res = f1 * 100 + f2 * 10 + f3
|
||||||
|
print "Chambre = %d " % res
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
53
archive/archives/cencode
Executable file
53
archive/archives/cencode
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# Dis, emacs, c'est du -*- python -*-
|
||||||
|
#
|
||||||
|
"""
|
||||||
|
Programme fait pour encoder les chambres suivant le cryptage standard
|
||||||
|
pour le bâtiment G (le F peut aussi s'en servir). Inutile au B, il y a déjà un
|
||||||
|
autre mapping (les prises réseau sont numérotées différemment des chambres)
|
||||||
|
|
||||||
|
Ceci ne résistera évidemment pas à une attaque cryptographique en règle.
|
||||||
|
|
||||||
|
L'algorithme étant réellement trivial, il est raisonnable de laisser ce
|
||||||
|
script "chmod 700" et "chown root:root" !
|
||||||
|
|
||||||
|
C.Chepelov 5 novembre 1998 (présente implémentation), mise au point de
|
||||||
|
l'algorithme et première implémentation en Reverse Polish Lisp (HP48) à
|
||||||
|
l'automne 1997.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print "usage : %s <numéro de chambre>" % sys.argv[0]
|
||||||
|
print "exemple : %s 126 --> 9378 " % sys.argv[0]
|
||||||
|
print "Ajouter G ou F selon bâtiment, W ou B selon gaine technique. "
|
||||||
|
print
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
s_arg = sys.argv[1]
|
||||||
|
try:
|
||||||
|
arg = int(s_arg)
|
||||||
|
if arg >= 1000: raise "pas bon."
|
||||||
|
except:
|
||||||
|
print "L'argument doit être un nombre inférieur à 1000 !"
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
# C'est pas du tout optimal, mais on s'en fout !
|
||||||
|
c1 = int(arg / 100) % 10
|
||||||
|
c2 = int(arg / 10) % 10
|
||||||
|
c3 = arg % 10
|
||||||
|
|
||||||
|
s = (c1 + c2 + c3) % 10
|
||||||
|
|
||||||
|
f3 = t1 = (10 - c1 + s) % 10
|
||||||
|
f2 = t2 = (10 - c2 + s) % 10
|
||||||
|
f1 = t3 = (10 - c3 + s) % 10
|
||||||
|
|
||||||
|
res = s * 1000 + f1 * 100 + f2 * 10 + f3
|
||||||
|
print "Code = %d " % res
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
3
archive/archives/chmodwww
Executable file
3
archive/archives/chmodwww
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
chmod a+rx $HOME $HOME/www
|
||||||
|
chmod -R a+r $HOME/www/*
|
26
archive/archives/claque-interfaces
Executable file
26
archive/archives/claque-interfaces
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# CC 2/2/1999 horrible kludge
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Pour des raisons bizarres (bug driver SMC ? matériel ?), les interfaces
|
||||||
|
# eth1 et eth2 bloquent régulièrement.
|
||||||
|
# en général, un claquage suffit à les relancer. Par ailleurs, un claquage
|
||||||
|
# ne bloque pas les communications -- on peut donc jouer à le faire
|
||||||
|
# régulièrement.
|
||||||
|
#
|
||||||
|
|
||||||
|
#a enlever les commentaires! 19.02
|
||||||
|
# 20/01/2000 jerome reactive le script
|
||||||
|
|
||||||
|
echo "Claquage des interfaces" | /usr/bin/logger -t "Claque" -p user.warn
|
||||||
|
|
||||||
|
ifconfig eth0 down; ifconfig eth0 up; route add default gw 138.231.136.2
|
||||||
|
|
||||||
|
ifconfig eth1 down; ifconfig eth1 up 138.231.136.130 netmask 255.255.252.0 broadcast 138.231.139.255
|
||||||
|
#ifconfig eth2 down; ifconfig eth2 up
|
||||||
|
#ifconfig eth3 down; ifconfig eth3 up
|
||||||
|
|
||||||
|
#ifconfig eth2 up 138.231.138.2 netmask 255.255.255.0 broadcast 138.231.138.255
|
||||||
|
#ifconfig eth2:1 up 138.231.138.2 netmask 255.255.255.0 broadcast 138.231.138.255
|
||||||
|
#ifconfig eth1:1 down 138.231.139.2 netmask 255.255.255.0 broadcast 138.231.139.255
|
||||||
|
#ifconfig eth1 up
|
144
archive/archives/configure_bornes_installparty
Executable file
144
archive/archives/configure_bornes_installparty
Executable file
|
@ -0,0 +1,144 @@
|
||||||
|
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
###################################
|
||||||
|
## Reconfigure une borne wifi ##
|
||||||
|
## du CR@NS en temps que routeur ##
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Ce scipt est à utiliser une fois que les interfaces de la bornes
|
||||||
|
# sont configurées
|
||||||
|
|
||||||
|
BORNE="install-party.crans.org"
|
||||||
|
DIR="/usr/scripts/install-party"
|
||||||
|
MACS="$DIR/MACS-install-party"
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
CLEF="/usr/scripts/gestion/clef-wifi"
|
||||||
|
SSH="ssh -i $CLEF -o StrictHostKeyChecking=no $BORNE"
|
||||||
|
SCP="scp -i $CLEF -o StrictHostKeyChecking=no"
|
||||||
|
|
||||||
|
usage () {
|
||||||
|
echo "Usage : "
|
||||||
|
echo " $0 --macs <borne> Modifie les MACS authorisées"
|
||||||
|
echo " $0 --services <borne> Relance les services"
|
||||||
|
echo " $0 --firewall <borne> Relance le firewall"
|
||||||
|
}
|
||||||
|
|
||||||
|
error=1
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# Edition du fichier de MACS
|
||||||
|
|
||||||
|
if [[ "$1" == "--macs" ]]
|
||||||
|
then
|
||||||
|
/usr/bin/jed $MACS
|
||||||
|
error=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# Reconfiguration des services
|
||||||
|
|
||||||
|
if [[ "$1" == "--services" ]]
|
||||||
|
then
|
||||||
|
# génération du script
|
||||||
|
echo "Création du script de reconfiguration"
|
||||||
|
cat > $DIR/boot.sh <<EOF
|
||||||
|
# ajout de la route
|
||||||
|
route add default gw 138.231.136.4 dev vlan0
|
||||||
|
|
||||||
|
# résolution de noms
|
||||||
|
echo "search crans.org" > /tmp/resolv.conf
|
||||||
|
echo "nameserver 138.231.136.6" >> /tmp/resolv.conf
|
||||||
|
echo "nameserver 138.231.136.10" >> /tmp/resolv.conf
|
||||||
|
|
||||||
|
# alias pour le dns
|
||||||
|
echo "127.0.0.1 localhost" > /etc/hosts
|
||||||
|
echo "138.231.136.7 debian.ens-cachan.fr ftp.crihan.fr" >> /etc/hosts
|
||||||
|
|
||||||
|
# dns
|
||||||
|
killall dnsmasq 2> /dev/null
|
||||||
|
/usr/sbin/dnsmasq
|
||||||
|
|
||||||
|
# dhcp filaire
|
||||||
|
echo "start 192.168.0.10" > /tmp/udhcpd.conf
|
||||||
|
echo "end 192.168.0.254" >> /tmp/udhcpd.conf
|
||||||
|
echo "interface vlan1" >> /tmp/udhcpd.conf
|
||||||
|
echo "opt dns 192.168.0.1 138.231.136.6" >> /tmp/udhcpd.conf
|
||||||
|
echo "option subnet 255.255.255.0" >> /tmp/udhcpd.conf
|
||||||
|
echo "option dns 138.231.136.10" >> /tmp/udhcpd.conf
|
||||||
|
echo "opt router 192.168.0.1" >> /tmp/udhcpd.conf
|
||||||
|
killall udhcpd 2> /dev/null
|
||||||
|
/usr/sbin/udhcpd /tmp/udhcpd.conf
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# envoi du fichier et execution
|
||||||
|
chmod 744 $DIR/boot.sh
|
||||||
|
echo "Envoi du script"
|
||||||
|
$SCP $DIR/boot.sh $BORNE:/tmp/boot.sh > /dev/null
|
||||||
|
|
||||||
|
# execution du script
|
||||||
|
echo "Execution du script"
|
||||||
|
$SSH /tmp/boot.sh
|
||||||
|
|
||||||
|
# destruction du fichier
|
||||||
|
rm -f $DIR/boot.sh
|
||||||
|
|
||||||
|
error=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# Reconfiguration du firewall
|
||||||
|
|
||||||
|
if [[ "$1" == "--firewall" ]] || [[ "$1" == "--macs" ]]
|
||||||
|
then
|
||||||
|
# génération du firewall
|
||||||
|
echo "Génération du firewall"
|
||||||
|
cat > $DIR/firewall.sh <<EOF
|
||||||
|
iptables -F
|
||||||
|
iptables -X
|
||||||
|
iptables -F -t nat
|
||||||
|
iptables -X -t nat
|
||||||
|
iptables -P FORWARD ACCEPT
|
||||||
|
iptables -t nat -P PREROUTING DROP
|
||||||
|
iptables -t nat --protocol icmp -d 192.169.0.1 -j ACCEPT
|
||||||
|
iptables -t nat -A PREROUTING -i vlan0 -j ACCEPT
|
||||||
|
iptables -t nat -A PREROUTING -i vlan1 -s ! 138.231.136.10 -p tcp --dport 80 -j DNAT --to 138.231.136.10:3128
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat $MACS | sed 's/ //g' | grep -v '#' | grep -v '^$' | while true
|
||||||
|
do
|
||||||
|
read mac
|
||||||
|
if [ "$mac" = "" ] ; then break ; fi
|
||||||
|
echo "iptables -t nat -A PREROUTING -i vlan1 -m mac --mac-source $mac -j ACCEPT" >> $DIR/firewall.sh
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "iptables -A POSTROUTING -t nat -o vlan0 -j MASQUERADE" >> $DIR/firewall.sh
|
||||||
|
|
||||||
|
# envoi du fichier et execution
|
||||||
|
chmod 744 $DIR/firewall.sh
|
||||||
|
echo "Envoi du firewall"
|
||||||
|
$SCP $DIR/firewall.sh $BORNE:/tmp/firewall.sh > /dev/null
|
||||||
|
|
||||||
|
# execution du script
|
||||||
|
echo "Lancement du firewall"
|
||||||
|
$SSH /tmp/firewall.sh
|
||||||
|
|
||||||
|
# destruction du fichier
|
||||||
|
rm -f $DIR/firewall.sh
|
||||||
|
|
||||||
|
error=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
if [ "$error" = "1" ]
|
||||||
|
then
|
||||||
|
usage
|
||||||
|
exit 2
|
||||||
|
fi
|
97
archive/archives/cvsweb/commit-news.py
Executable file
97
archive/archives/cvsweb/commit-news.py
Executable file
|
@ -0,0 +1,97 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: iso-8859-1 -*-
|
||||||
|
#
|
||||||
|
# Hack par CC 13/07/1999 pour envoyer sur crans.cvs-checkins un
|
||||||
|
# compte-rendu d'activité de ce qui se passe...
|
||||||
|
#
|
||||||
|
# modif par SamK 22/11/99: splitter les lignes, sinon nntplib refuse le message
|
||||||
|
# si ya des lignes trop longues..
|
||||||
|
#
|
||||||
|
# modif par OS 15/05/00 ajout d'un Reply-To...
|
||||||
|
#
|
||||||
|
# Ajouts par NS 13/02/03 : signature qui explique un peu ce qui se passe, et
|
||||||
|
# création automatique d'un lien vers la page webcvs qui présente le diff.
|
||||||
|
#
|
||||||
|
# Modif par Benoit 11/12/04 : changement du repertoire ou sont loggue les
|
||||||
|
# commits et fermeture du fichier
|
||||||
|
#
|
||||||
|
# Intimement lié à CVSROOT/loginfo
|
||||||
|
#
|
||||||
|
|
||||||
|
import nntplib,string,os,StringIO
|
||||||
|
|
||||||
|
def LFsplit(s):
|
||||||
|
res=""
|
||||||
|
while len(s)>80 :
|
||||||
|
pos=string.find(s,' ',65,80)
|
||||||
|
if pos < 0 :
|
||||||
|
res=res+s[0:75]+'\n'
|
||||||
|
s=s[75:len(s)+1]
|
||||||
|
else :
|
||||||
|
res=res+s[0:pos]+'\n'
|
||||||
|
s=s[pos+1:len(s)+1]
|
||||||
|
if len(s)>0:
|
||||||
|
res=res+s
|
||||||
|
return res
|
||||||
|
|
||||||
|
for uid in os.listdir('/var/local/cvsweb/checkins/'):
|
||||||
|
try:
|
||||||
|
so = []
|
||||||
|
fi = open('/var/local/cvsweb/checkins/'+uid,'r')
|
||||||
|
|
||||||
|
so.append("From: CVS admin <root@crans.org>\n" + \
|
||||||
|
("Subject: CVS Commit par %s\n" % uid)+ \
|
||||||
|
"Organization: Crans Internet Site\n" + \
|
||||||
|
"Newsgroups: crans.cvs-checkins\n" + \
|
||||||
|
"Reply-To: Nounous <nounou@crans.org>\n" + \
|
||||||
|
"Followup-To: crans.informatique\n" )
|
||||||
|
|
||||||
|
so.append("MIME-Version: 1.0\n" + \
|
||||||
|
"Content-Type: text/plain\n")
|
||||||
|
so.append("\n")
|
||||||
|
envoie = 0
|
||||||
|
links_base="http://www.crans.org/cgi-bin/cvsweb"
|
||||||
|
while 1:
|
||||||
|
s = fi.readline()
|
||||||
|
if not s: break
|
||||||
|
envoie = 1
|
||||||
|
links=['Liens vers les diffs sur cvsweb :\n']
|
||||||
|
diffok = 0
|
||||||
|
|
||||||
|
# On essaye de créer les liens vers cvsweb automatiquement.
|
||||||
|
try:
|
||||||
|
if s[0:3]=="web":
|
||||||
|
link=string.split(s)
|
||||||
|
for file in link[1:]:
|
||||||
|
file=string.split(file,",")
|
||||||
|
if not string.split(file[0],".")[-1] in ['jpg','jpeg','gif','png']:
|
||||||
|
links.append("%s/%s/%s.diff?r1=%s&r2=%s\n" % (links_base,link[0],file[0],file[1],file[2]))
|
||||||
|
diffok = 1
|
||||||
|
# S'il y a au moins un diff affichable, on donne le lien.
|
||||||
|
if diffok:
|
||||||
|
links.append('\n')
|
||||||
|
s=string.join(links,'')
|
||||||
|
else:
|
||||||
|
s=LFsplit(s)
|
||||||
|
so.append(s)
|
||||||
|
except:
|
||||||
|
so.append(s)
|
||||||
|
# Avec une signature c'est plus propre.
|
||||||
|
so.append("\n" + \
|
||||||
|
"-- \n" + \
|
||||||
|
"Notification automatique des CVS commits sur le site du CR@NS.\n"+ \
|
||||||
|
"Voir http://www.crans.org/cgi-bin/cvsweb/web/ pour accéder aux archives CVS complètes.")
|
||||||
|
|
||||||
|
|
||||||
|
# maintenant, on envoie :
|
||||||
|
|
||||||
|
if envoie:
|
||||||
|
sso = string.join(so,'')
|
||||||
|
fso = StringIO.StringIO(sso)
|
||||||
|
nntplib.NNTP('news.crans.org').post(fso)
|
||||||
|
#print sso
|
||||||
|
fi.close()
|
||||||
|
os.unlink('/var/local/cvsweb/checkins/'+uid)
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
19
archive/archives/cvsweb/update.sh
Executable file
19
archive/archives/cvsweb/update.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Mise à jour de l'arborescence du site web
|
||||||
|
# Execute toutes les minutes (par root).
|
||||||
|
|
||||||
|
OQP=/var/lock/cvsweb
|
||||||
|
CHEMIN=/var/local/cvsweb
|
||||||
|
REPOSITORY=/home/httpd/CVS-Repository/
|
||||||
|
|
||||||
|
if [ $CHEMIN/commit.todo -nt $CHEMIN/commit.ok ]; then
|
||||||
|
if ! [[ -f $OQP ]]; then
|
||||||
|
chown -R www-data:webcvs $REPOSITORY
|
||||||
|
chmod -R o-rwx $REPOSITORY
|
||||||
|
touch $OQP
|
||||||
|
cd /home/httpd/web
|
||||||
|
su www-data -c "/usr/bin/cvs -d $REPOSITORY update -P -d" >/dev/null 2>&1
|
||||||
|
test -s $OQP || rm -f $OQP
|
||||||
|
su www-data -c "touch $CHEMIN/commit.ok"
|
||||||
|
fi
|
||||||
|
fi
|
16
archive/archives/fan-speed
Executable file
16
archive/archives/fan-speed
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#donne la vitesse du ventilateur CPU
|
||||||
|
echo 0
|
||||||
|
#allez, on met 1000 au pif, ça nous rappellera que ce chiffre est bidon. --nico
|
||||||
|
#echo 1000
|
||||||
|
#en attendant de remettre i2c sensors, cette ligne est commentée :
|
||||||
|
cat /proc/sys/dev/sensors/w83781d-i2c-0-2d/fan2 | tail -c 5
|
||||||
|
#
|
||||||
|
#| head -c 4
|
||||||
|
#echo $(cat /proc/sys/dev/sensors/w83781d-i2c-0-2d/temp2 | tail -c 5 | head -c 2 )"/1-30"|bc
|
||||||
|
#cat /proc/sys/dev/sensors/w83781d-i2c-0-2d/temp1 | sed -e 's/.*60.0 50.0 //' | sed -e's/\0//' -e 's/\.//'
|
||||||
|
#cat /proc/sys/dev/sensors/w83781d-i2c-0-2d/temp2 | sed -e 's/.*57.0 50.0 //' | sed -e's/\0//' -e 's/\.//'
|
||||||
|
#echo 10
|
||||||
|
#echo 10
|
||||||
|
echo
|
||||||
|
echo "Ventilation"
|
BIN
archive/archives/mailCRANS
Executable file
BIN
archive/archives/mailCRANS
Executable file
Binary file not shown.
280
archive/archives/mailCRANS.c
Normal file
280
archive/archives/mailCRANS.c
Normal file
|
@ -0,0 +1,280 @@
|
||||||
|
/*
|
||||||
|
* Mail a tous les adherents de CRANS.
|
||||||
|
*
|
||||||
|
* Copyright (c) 1999 Association CRANS.
|
||||||
|
*
|
||||||
|
* Auteur: Olivier Saut <Olivier.Saut@CRANS.ENS-Cachan.Fr>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/errno.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
#include <err.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <paths.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <sys/uio.h>
|
||||||
|
|
||||||
|
#define kPCGuestUID 502
|
||||||
|
#define kCorbeauUID 536
|
||||||
|
#define kNobodyUID 65534
|
||||||
|
#define kRealUsers 500
|
||||||
|
|
||||||
|
/* Prototypes */
|
||||||
|
int mk_tmpfile();
|
||||||
|
void edit();
|
||||||
|
int sendmail(char *name);
|
||||||
|
void help();
|
||||||
|
int isValidUID(uid_t uid);
|
||||||
|
void mySig_handler(int iInt);
|
||||||
|
|
||||||
|
/* Variables globales */
|
||||||
|
char *gTempname;
|
||||||
|
uid_t gCurrent_UID;
|
||||||
|
uid_t gUid_start;
|
||||||
|
uid_t gUid_stop;
|
||||||
|
int gVerbose;
|
||||||
|
int gSimulate;
|
||||||
|
|
||||||
|
/* Programme principal */
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
|
||||||
|
struct passwd *passwd_ent;
|
||||||
|
struct passwd *user;
|
||||||
|
char buf[1024];
|
||||||
|
extern char *optarg;
|
||||||
|
extern int optind;
|
||||||
|
int ch ;
|
||||||
|
struct stat begin, end;
|
||||||
|
sig_t previous_handler;
|
||||||
|
char tildefn[MAXPATHLEN];
|
||||||
|
int fd=-1;
|
||||||
|
|
||||||
|
|
||||||
|
gUid_start=kRealUsers;
|
||||||
|
gUid_stop=kNobodyUID;
|
||||||
|
gVerbose=0;
|
||||||
|
gSimulate=0;
|
||||||
|
while ((ch = getopt(argc, argv, "svhf:d:a:")) != -1)
|
||||||
|
switch (ch) {
|
||||||
|
case 'h':
|
||||||
|
help();
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
gVerbose=1;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
gVerbose=1;
|
||||||
|
gSimulate=1;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
gTempname=optarg;
|
||||||
|
if ((fd = open(optarg, O_RDONLY, 0)) < 0) {
|
||||||
|
(void)fprintf(stderr,
|
||||||
|
"myname: %s: %s\n", optarg, strerror(errno));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
gUid_start=atoi(optarg);
|
||||||
|
break;
|
||||||
|
case 'a':
|
||||||
|
gUid_stop=atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
argc -= optind;
|
||||||
|
argv += optind;
|
||||||
|
|
||||||
|
previous_handler = signal(SIGTERM & SIGINT,(sig_t) mySig_handler);
|
||||||
|
if(previous_handler==SIG_ERR) {
|
||||||
|
(void)fprintf(stderr,"Erreur lors de l'installation du sighandler.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(gVerbose)
|
||||||
|
fprintf(stdout,"mailCRANS by OS. Version 0.1\n");
|
||||||
|
|
||||||
|
if(fd==-1) {
|
||||||
|
fd=mk_tmpfile();
|
||||||
|
user=getpwuid(getuid());
|
||||||
|
sprintf(buf,"From: %s\nSubject: \nReply-To: \nContent-Type: text/plain; charset=iso-8859-1", user->pw_name);
|
||||||
|
|
||||||
|
if (write (fd,(void *)buf,strlen(buf)) < 0) {
|
||||||
|
close(fd);
|
||||||
|
fprintf(stderr, "Erreur en écriture.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
(void) fsync(fd);
|
||||||
|
if(fstat(fd,&begin)) {
|
||||||
|
perror("Erreur stat(1)");
|
||||||
|
close(fd);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
(void) edit();
|
||||||
|
|
||||||
|
if(stat(gTempname,&end)) {
|
||||||
|
perror("Erreur stat(2)");
|
||||||
|
close(fd);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (begin.st_mtime == end.st_mtime) {
|
||||||
|
warnx("No changes made : exiting");
|
||||||
|
close(fd);
|
||||||
|
(void)unlink(gTempname);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setpwent();
|
||||||
|
|
||||||
|
while((int)(passwd_ent=(struct passwd *)getpwent())) {
|
||||||
|
gCurrent_UID=passwd_ent->pw_uid;
|
||||||
|
|
||||||
|
if(isValidUID(gCurrent_UID))
|
||||||
|
if(sendmail(passwd_ent->pw_name )) {
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
usleep(250000);
|
||||||
|
}
|
||||||
|
|
||||||
|
endpwent();
|
||||||
|
|
||||||
|
(void)unlink(gTempname);
|
||||||
|
/* Bon on efface le fichier parasite */
|
||||||
|
(void)strcpy((char *)tildefn,gTempname);
|
||||||
|
(void)strcat((char *)tildefn,"~");
|
||||||
|
|
||||||
|
if(!access(tildefn,F_OK))
|
||||||
|
(void)unlink(tildefn);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isValidUID(uid_t uid) {
|
||||||
|
if(uid<gUid_start)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(uid>gUid_stop)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if((uid==kPCGuestUID)|| (uid==kCorbeauUID) || (uid==kNobodyUID))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mySig_handler(int iInt) {
|
||||||
|
(void) fprintf(stdout,"\n Signal %d intercepté.\n",iInt);
|
||||||
|
(void) fprintf(stderr,"Le programme s'est arreté sur l'uid : %d\n",gCurrent_UID);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mk_tmpfile()
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
char p[MAXPATHLEN];
|
||||||
|
p[MAXPATHLEN-1]='\0';
|
||||||
|
|
||||||
|
strcpy(p, "/tmp/EAll.XXXXXX");
|
||||||
|
if ((fd = mkstemp(p)) == -1)
|
||||||
|
err(1, "%s", p);
|
||||||
|
gTempname = malloc(strlen(p));
|
||||||
|
(void)strncpy(gTempname,p,strlen(p));
|
||||||
|
if(gVerbose)
|
||||||
|
fprintf(stdout,"Tempfile name : %s\n",gTempname);
|
||||||
|
return (fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void edit()
|
||||||
|
{
|
||||||
|
int pstat;
|
||||||
|
int editpid;
|
||||||
|
char *p, *editor;
|
||||||
|
|
||||||
|
if (!(editor = getenv("EDITOR")))
|
||||||
|
editor = _PATH_VI;
|
||||||
|
if ((p = strrchr(editor, '/')))
|
||||||
|
++p;
|
||||||
|
else
|
||||||
|
p = editor;
|
||||||
|
|
||||||
|
if (!(editpid = fork())) {
|
||||||
|
errno = 0;
|
||||||
|
execlp(editor, p, gTempname, NULL);
|
||||||
|
_exit(errno);
|
||||||
|
}
|
||||||
|
for (;;) {
|
||||||
|
editpid = waitpid(editpid, (int *)&pstat, WUNTRACED);
|
||||||
|
errno = WEXITSTATUS(pstat);
|
||||||
|
(void) fprintf(stderr,"\n *** %d ***\n",WEXITSTATUS(pstat));
|
||||||
|
if (editpid == -1)
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
else if (WIFSTOPPED(pstat))
|
||||||
|
raise(WSTOPSIG(pstat));
|
||||||
|
else if (WIFEXITED(pstat) && errno == 0)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
editpid = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int sendmail(char *pw_name) {
|
||||||
|
int res=0;
|
||||||
|
char *buff;
|
||||||
|
int length;
|
||||||
|
buff=malloc(1024);
|
||||||
|
|
||||||
|
buff[1023]='\0';
|
||||||
|
buff[0]='\0';
|
||||||
|
|
||||||
|
(void)strcat((char *)buff,(const char *)"cat ");
|
||||||
|
(void)strcat(buff,(const char *) gTempname);
|
||||||
|
(void)strcat(buff, " | sendmail ");
|
||||||
|
(void)strcat(buff, pw_name);
|
||||||
|
if(gVerbose)
|
||||||
|
fprintf(stdout,"\n ** %s ** \n", buff);
|
||||||
|
if(!gSimulate)
|
||||||
|
res=system(buff);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void help() {
|
||||||
|
fprintf(stdout,"usage: mailCRANS [-v] [-s] [-f filename] [-{d,a} uid]\n");
|
||||||
|
fprintf(stdout," -v : mode bavard\n");
|
||||||
|
fprintf(stdout," -f filename : envoie le fichier en argument\n");
|
||||||
|
fprintf(stdout," (rajouter une ligne Subject: en première ligne du fichier pour avoir un sujet\n");
|
||||||
|
fprintf(stdout," -d uid : envoie à partir de l'UID argument\n");
|
||||||
|
fprintf(stdout," -a uid : arrete après l'UID argument\n");
|
||||||
|
fprintf(stdout," -s : mode simulation.");
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
21
archive/archives/mailvirus
Normal file
21
archive/archives/mailvirus
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
Bonjour,
|
||||||
|
|
||||||
|
Suite à la récente multiplication d'un virus nommé 'Klez' sur le réseau
|
||||||
|
CRANS, nous avons décidé de faire en sorte temporairement que tous les mails
|
||||||
|
contenant un fichier attaché nommé .exe, .pif, .bat ou .scr soient
|
||||||
|
automatiquement rejetés par notre serveur, sans autre forme d'avertissement.
|
||||||
|
La situation restera ainsi jusqu'à mise à jour des antivirus communément
|
||||||
|
répandus.
|
||||||
|
|
||||||
|
Pendant cette période, si vous attendez effectivement un mail contenant une
|
||||||
|
pièce jointe nommé de la sorte, essayez de faire en sorte que l'expéditeur
|
||||||
|
en change l'extension (par exemple en en faisant un .zip).
|
||||||
|
|
||||||
|
En raison de la rapidité extrême avec laquelle se répand ce virus, nous
|
||||||
|
serons éventuellement amenés à déconnecter du réseau les machines infectées.
|
||||||
|
|
||||||
|
http://www.sarc.com/avcenter/venc/data/w32.klez.e@mm.html
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
Nicolas Stransky
|
7
archive/archives/netrestart
Executable file
7
archive/archives/netrestart
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# 5 retries (6 en tout), quiet.
|
||||||
|
if ! fping 138.231.136.2 -r 5 -q;
|
||||||
|
then
|
||||||
|
echo "irts AUTOTEST failed" | logger -s -p daemon.err -t "/id/netrestart"
|
||||||
|
/id/network reload
|
||||||
|
fi
|
128
archive/archives/news-cancel
Executable file
128
archive/archives/news-cancel
Executable file
|
@ -0,0 +1,128 @@
|
||||||
|
#!/bin/sh
|
||||||
|
##
|
||||||
|
## news-cancel
|
||||||
|
##
|
||||||
|
## Made by stransky
|
||||||
|
## Login stransky <stransky@crans.org>
|
||||||
|
##
|
||||||
|
## Started on dim 13 jan 2002 02:30:56 CET Nicolas STRANSKY
|
||||||
|
## Last update ven 19 sep 2003 14:21:27 CEST Nicolas STRANSKY
|
||||||
|
##
|
||||||
|
## Script pour annuler ou modérer un message de news.
|
||||||
|
##
|
||||||
|
## V 1.0 : utilisation de la commande ctlinnd cancel.
|
||||||
|
## V 2.0 : utilisation des commandes control cancel et supersede pour assurer
|
||||||
|
## la propagation des modifications effectuées.
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "${ORIG_LOGNAME-$SUDO_USER}" = "" ]]
|
||||||
|
then moderateur=`who am i | awk '{print $1}'`
|
||||||
|
else moderateur=${ORIG_LOGNAME-$SUDO_USER}
|
||||||
|
fi
|
||||||
|
|
||||||
|
ovfiles=$(grep "^[[:digit:]]" /etc/news/buffindexed.conf | cut -d ':' -f 2 | tr "\n" " ")
|
||||||
|
groupe=adm
|
||||||
|
tempF=$(tempfile -d /tmp -p "newscancel")
|
||||||
|
tempF2=$(tempfile -d /tmp -p "newscancelcommentaire")
|
||||||
|
tempF3=$(tempfile -d /tmp -p "newscancelmessage")
|
||||||
|
|
||||||
|
VERIF () {
|
||||||
|
ligne=`grep -h --binary-files=text " $1 " $ovfiles | head -n 1 | awk -F "\t" '{print $1"~"$2"~"$3"~"$9}'`
|
||||||
|
auteur=`echo $ligne | awk -F "~" '{print $3}'`
|
||||||
|
titre=`echo $ligne | awk -F "~" '{print $2}'`
|
||||||
|
newsgroup=`echo $ligne | awk -F "~" '{print $4}' | awk '{print $3}' | awk -F : '{print $1}'`
|
||||||
|
#numero=`echo $ligne | awk -F "~" '{print $1}'`
|
||||||
|
numero=`echo $ligne | awk -F "~" '{print $4}' |awk -v VAR1=$newsgroup 'BEGIN {RS = " "} ; $0 ~ VAR1 {print $1}' | awk -F ":" '{print strtonum($2)}'`
|
||||||
|
|
||||||
|
if [[ $ligne != "" ]] ; then
|
||||||
|
echo "il s'agit du message \"$titre\", numéro $numero, posté par $auteur dans $newsgroup"
|
||||||
|
echo ""
|
||||||
|
echo -n "exact ? [o/n] "
|
||||||
|
read confirmation
|
||||||
|
case $confirmation in
|
||||||
|
o*|O*)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "On ne fait rien."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "Aucun message ne correspond à cette ID"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SAUVEGARDE () {
|
||||||
|
echo "Sauvegarde du message dans /root/moderes/..."
|
||||||
|
sleep 1
|
||||||
|
rep=`echo $newsgroup | sed 's/\./\//g'`
|
||||||
|
cp /var/spool/news/articles/$rep/$numero /root/moderes/$newsgroup'.'$numero.nws
|
||||||
|
echo "$1 de $newsgroup.$numero" > $tempF
|
||||||
|
echo " " >> $tempF
|
||||||
|
echo "modérateur : $moderateur" >> $tempF
|
||||||
|
echo "commentaires : " > $tempF2
|
||||||
|
chown $moderateur.$groupe $tempF2
|
||||||
|
/bin/su $moderateur -c "$EDITOR $tempF2"
|
||||||
|
cat $tempF2 >> $tempF
|
||||||
|
echo "Envoi du mail aux modérateurs..."
|
||||||
|
cat $tempF | mutt -nx -a /root/moderes/$newsgroup'.'$numero.nws -s "moderation de $newsgroup.$numero par $moderateur" moderateurs@crans.org
|
||||||
|
rm -f $tempF $tempF2
|
||||||
|
echo " "
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EDITION () {
|
||||||
|
cp /var/spool/news/articles/$rep/$numero $tempF3
|
||||||
|
chown $moderateur.$groupe $tempF3
|
||||||
|
/bin/su $moderateur -c "$EDITOR $tempF3"
|
||||||
|
(sleep 1 ; echo "mode reader" ; sleep 1 ; echo "group $newsgroup" ; sleep 1 ; echo post ; sleep 1 ; echo "Supersedes: $1" ; cat $tempF3 | egrep -v "^Message-ID:|^NNTP-Posting|^Path:|^X-Trace:|^X-Complaints-To:|^Xref:" ; echo '.' ; sleep 1 ; echo quit) | nc 138.231.136.3 119
|
||||||
|
rm -f $tempF3
|
||||||
|
}
|
||||||
|
|
||||||
|
CANCEL () {
|
||||||
|
# echo -n 'throttling inn... '
|
||||||
|
# /bin/su news -c "/usr/lib/news/bin/ctlinnd throttle 'article canceling'"
|
||||||
|
# echo "canceling article $1"
|
||||||
|
# /bin/su news -c "/usr/lib/news/bin/ctlinnd cancel $1"
|
||||||
|
#
|
||||||
|
# echo -n 'starting inn... '
|
||||||
|
# /bin/su news -c "/usr/lib/news/bin/ctlinnd go ''"
|
||||||
|
|
||||||
|
(sleep 1 ; echo "mode reader" ; sleep 1 ; echo "group $newsgroup" ; sleep 1 ; echo post ; sleep 1 ; echo "Control: cancel $1" ; echo "From: $moderateur@crans.org" ; echo "Subject: Moderation" ; echo "Newsgroups: $newsgroup" ; echo -e "\n" ; echo "This post has been moderated with news-cancel." ; echo '.' ; sleep 1 ; echo quit) | nc news.crans.org 119
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ $UID -eq 0 ]
|
||||||
|
then
|
||||||
|
case $1 in
|
||||||
|
\<*@*\>)
|
||||||
|
VERIF $1
|
||||||
|
echo "Edition ou Annulation du message ? [E/A] "
|
||||||
|
read action
|
||||||
|
case $action in
|
||||||
|
e*|E*)
|
||||||
|
SAUVEGARDE Edition
|
||||||
|
EDITION $1
|
||||||
|
;;
|
||||||
|
a*|A*)
|
||||||
|
SAUVEGARDE Annulation
|
||||||
|
CANCEL $1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "attention, il n'y a eu ni édition ni annulation. relancer le script"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "usage : news-cancel '<Message-ID>'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "You must be root to launch this command."
|
||||||
|
exit 1
|
||||||
|
fi
|
7
archive/archives/pop3s-restart
Executable file
7
archive/archives/pop3s-restart
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#/bin/sh
|
||||||
|
PIFILE="/var/run/stunnel.tunnel-pop.pid"
|
||||||
|
OPTIONS="-d 995 -r 110 tunnel-pop -p /etc/ssl/certs/stunnel-ptt.pem"
|
||||||
|
|
||||||
|
if [ $(netstat -l --tcp | grep -c ' \*:pop3s') -eq 0 ]; then
|
||||||
|
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec /usr/sbin/stunnel -- $OPTIONS ;
|
||||||
|
fi
|
9
archive/archives/redpopup
Executable file
9
archive/archives/redpopup
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
||||||
|
PYTHONPATH=/usr/lib/python-1.5/
|
||||||
|
|
||||||
|
cd /etc/CRANS
|
||||||
|
echo $1 $2 $3 $4 $5 > /tmp/last.popup.log
|
||||||
|
exec python /etc/CRANS/code/redpopup.py $1 $2 $3 $4 $5 >&2 2>/tmp/last.popup.err
|
||||||
|
|
||||||
|
|
76
archive/archives/redpopup.py
Executable file
76
archive/archives/redpopup.py
Executable file
|
@ -0,0 +1,76 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- python -*-
|
||||||
|
import sys,time,os,pickle,string,popen2,random
|
||||||
|
|
||||||
|
FORKLEN = 5
|
||||||
|
TIMEOUT = 15 # une machine a 15 secondes pour recevoir un popup !
|
||||||
|
|
||||||
|
def do_bomb(Machines):
|
||||||
|
time.sleep(random.random())
|
||||||
|
if len(Machines) < FORKLEN:
|
||||||
|
for mach in Machines:
|
||||||
|
begin = time.time()
|
||||||
|
print "ré-expédition SMBpopup à ",mach
|
||||||
|
fd = popen2.Popen3("/etc/CRANS/code/SMBMessage %s %s %s" % (from_whom,mach,msgfile))
|
||||||
|
while 1:
|
||||||
|
time.sleep(1)
|
||||||
|
if fd.poll() != -1: break # fini ! (cool)
|
||||||
|
if (time.time() - begin) > TIMEOUT: break
|
||||||
|
del fd
|
||||||
|
else:
|
||||||
|
Half = len(Machines) / 2
|
||||||
|
|
||||||
|
pid = os.fork()
|
||||||
|
if pid == 0:
|
||||||
|
# child
|
||||||
|
do_bomb(Machines[:Half])
|
||||||
|
else:
|
||||||
|
# parent
|
||||||
|
do_bomb(Machines[Half:])
|
||||||
|
try:
|
||||||
|
os.waitpid(pid,0)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
# à ce stade, on a éliminé toute récursion, tant pile que process...
|
||||||
|
# croisons les doigts !!!
|
||||||
|
|
||||||
|
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
sys.stderr.write('Attend 3 arguments !\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
Zone = pickle.load(open(CFG_READ_DIR+"Zone.db","r"))
|
||||||
|
|
||||||
|
from_whom = sys.argv[1]
|
||||||
|
from_where = sys.argv[2]
|
||||||
|
msgfile = sys.argv[3]+"-red"
|
||||||
|
message = open(sys.argv[3],"r").readlines()
|
||||||
|
|
||||||
|
message.insert(0,("Message de %s (@%s) à ALL : \n-----\n" % (from_whom,from_where)))
|
||||||
|
open(msgfile,"w").writelines(message)
|
||||||
|
|
||||||
|
|
||||||
|
# pour gagner du temps, on n'envoie le message qu'aux machines qui sont
|
||||||
|
# (probablement) vivantes. Pour gagner encore plus de temps, on fait
|
||||||
|
# confiance au cache ARP (15 minutes)
|
||||||
|
|
||||||
|
Alive = []
|
||||||
|
arp = os.popen("arp -a","r")
|
||||||
|
while 1:
|
||||||
|
s = arp.readline()
|
||||||
|
if not s: break
|
||||||
|
mach = string.split(string.split(s)[0],'.')[0]
|
||||||
|
if mach[:5] == 'zamok': continue # évitons les boucles infininies...
|
||||||
|
if Zone.has_key(mach): Alive.append(mach)
|
||||||
|
print Alive
|
||||||
|
|
||||||
|
arp.close()
|
||||||
|
|
||||||
|
#maintenant, au boulot...
|
||||||
|
do_bomb(Alive)
|
||||||
|
unlink(msgfile)
|
||||||
|
unlink(sys.argv[3])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
12
archive/archives/restart-all
Executable file
12
archive/archives/restart-all
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/zsh -p
|
||||||
|
# suid !!
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
echo "restarting the named (DNS) :"
|
||||||
|
kill -HUP `cat /var/run/named.pid`
|
||||||
|
|
||||||
|
echo "restarting the DHCP : "
|
||||||
|
#kill -TERM `cat /var/run/dhcpd.pid` || true
|
||||||
|
#/usr/sbin/dhcpd
|
||||||
|
/etc/init.d/dhcp reload
|
15
archive/archives/save-etc
Executable file
15
archive/archives/save-etc
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
freq="$1"
|
||||||
|
nb=$2
|
||||||
|
|
||||||
|
pref="/backups/tars/etc${freq}-"
|
||||||
|
suff=`date +"%Y-%m-%d--%H-%M-%S.tgz"`
|
||||||
|
tarball="${pref}${suff}"
|
||||||
|
|
||||||
|
umask 077
|
||||||
|
cd /
|
||||||
|
tar zcf ${tarball} etc usr/lib/cgi-bin usr/scripts root/scripts home/corbeau/scripts
|
||||||
|
rm `ls -t ${pref}* | tail +$nb`
|
||||||
|
|
||||||
|
#df
|
24
archive/archives/sendmail-vit-il
Executable file
24
archive/archives/sendmail-vit-il
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- Python -*-
|
||||||
|
|
||||||
|
# teste si notre sendmail fonctionne encore.
|
||||||
|
|
||||||
|
from socket import *
|
||||||
|
import sys
|
||||||
|
|
||||||
|
OK = 0
|
||||||
|
|
||||||
|
host = "localhost"
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
host = sys.argv[1]
|
||||||
|
|
||||||
|
s = socket(AF_INET,SOCK_STREAM)
|
||||||
|
try:
|
||||||
|
s.connect(host,25)
|
||||||
|
data = s.recv(3)
|
||||||
|
OK = ("220" == data)
|
||||||
|
s.close()
|
||||||
|
except:
|
||||||
|
OK = 0
|
||||||
|
|
||||||
|
sys.exit(not OK)
|
1277
archive/archives/snmp/Des5200.mib
Normal file
1277
archive/archives/snmp/Des5200.mib
Normal file
File diff suppressed because it is too large
Load diff
804
archive/archives/snmp/iog-crans
Executable file
804
archive/archives/snmp/iog-crans
Executable file
|
@ -0,0 +1,804 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# IOG v1.0 - Input/Output Grapher
|
||||||
|
# Copyright (c) 2000-2002 James Dogopoulos <jd@dynw.com>
|
||||||
|
#
|
||||||
|
# Please read the "Artistic" license included.
|
||||||
|
#
|
||||||
|
# E-mail iog@dynw.com with any bug reports,
|
||||||
|
# fixes or comments.
|
||||||
|
#
|
||||||
|
|
||||||
|
BEGIN{
|
||||||
|
if ($ARGV[0] eq "NT") { $main::OS = 'NT'; } else { $main::OS = 'UNIX'; }
|
||||||
|
|
||||||
|
$main::SL = { UNIX=>'/', NT=>'\\' }->{$main::OS};
|
||||||
|
$main::PS = { UNIX=>':', NT=>';' }->{$main::OS};
|
||||||
|
|
||||||
|
$main::binpath ="";
|
||||||
|
if ($0 =~ /^(.+\Q${main::SL}\E)/) { $main::binpath="$1";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach $pathname ( split ${main::PS}, $ENV{'PATH'}) {
|
||||||
|
if ((($main::OS eq 'NT') && (-e "$pathname${main::SL}$0")) ||
|
||||||
|
(-x "$pathname${main::SL}$0")) {
|
||||||
|
$main::binpath=$pathname;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unshift (@INC,$main::binpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
use SDBM_File;
|
||||||
|
use BER;
|
||||||
|
use SNMP_Session;
|
||||||
|
use Fcntl;
|
||||||
|
|
||||||
|
my($inoid,$outoid,$host,$community,$snmpget,$datafile,$cfgfile,%inf);
|
||||||
|
my($inoctets,$outoctets,$path,$iogver,$hostreset,$kbsize,$mbsize,$gbsize);
|
||||||
|
|
||||||
|
$cfgfile="/etc/iog.cfg";
|
||||||
|
$iogver="v1.0";
|
||||||
|
|
||||||
|
# Default Byte Sizes
|
||||||
|
|
||||||
|
$kbsize="1024";
|
||||||
|
$mbsize="1048576";
|
||||||
|
$gbsize="1073";
|
||||||
|
|
||||||
|
# Date/Time stuff
|
||||||
|
#
|
||||||
|
|
||||||
|
my @weekdays = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday);
|
||||||
|
|
||||||
|
my @months = qw(January February March April May June July August September
|
||||||
|
October November December);
|
||||||
|
|
||||||
|
my %days = (1 => "1st", 2 => "2nd", 3 => "3rd", 21 => "21st", 22 => "22nd",
|
||||||
|
23 => "23rd", 31 => "31st");
|
||||||
|
|
||||||
|
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||||
|
$lday = $mday - 1;
|
||||||
|
|
||||||
|
sub last_mday {
|
||||||
|
my ($month, $year) = @_;
|
||||||
|
( qw(31 0 31 30 31 30 31 31 30 31 30 31) )[$month] ||
|
||||||
|
28 + (($year % 100 && !($year % 4))|| !($year % 400));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($days{$mday}) { $pday = $days{$mday}; $nday = $days{$lday}; }
|
||||||
|
else { $pday = $mday."th"; $nday = $lday."th"; }
|
||||||
|
|
||||||
|
# Read config file.
|
||||||
|
#
|
||||||
|
|
||||||
|
open(CONFIG,$cfgfile) || die("Cannot open $cfgfile!");
|
||||||
|
|
||||||
|
while (<CONFIG>) {
|
||||||
|
s/\s+$//g; # remove whitespace at the end of the line
|
||||||
|
s/\s/ /g; # replace whitespace by space
|
||||||
|
next if /^\s*\#/; # ignore comment lines
|
||||||
|
next if /^\s*$/; # ignore empty lines
|
||||||
|
if ($_ =~ /\[.*.\]/) { chkuptime($_); next; }
|
||||||
|
my($name,$host,$community,$inoid,$outoid,$path) = split(/:/, $_);
|
||||||
|
$path =~ s/\n//;
|
||||||
|
$datafile = "$name".".dat";
|
||||||
|
my @results = snmpget2($host,$community,$inoid,$outoid);
|
||||||
|
next if ($results[0] eq "error");
|
||||||
|
$inoctets = $results[0];
|
||||||
|
$outoctets = $results[1];
|
||||||
|
main($name,$host,$community,$inoid,$outoid,$path,$datafile);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(CONFIG);
|
||||||
|
|
||||||
|
|
||||||
|
# SNMP Get routine. Thanks to Simon Leinen for the SNMP module.
|
||||||
|
# http://www.switch.ch/misc/leinen/snmp/perl/
|
||||||
|
#
|
||||||
|
|
||||||
|
sub snmpget {
|
||||||
|
my($host, $community, $inoid, $outoid) = @_;
|
||||||
|
my($response, $bindings, $binding, $value, $oid, $session, @results);
|
||||||
|
|
||||||
|
my %oidnames = qw(ifInOctets 1.3.6.1.2.1.2.2.1.10
|
||||||
|
ifOutOctets 1.3.6.1.2.1.2.2.1.16
|
||||||
|
ifHCInOctets 1.3.6.1.2.1.31.1.1.1.6
|
||||||
|
ifHCOutOctets 1.3.6.1.2.1.31.1.1.1.10);
|
||||||
|
|
||||||
|
my ($inoidname,$inoidport) = split(/\./, $inoid);
|
||||||
|
my ($outoidname,$outoidport) = split(/\./, $outoid);
|
||||||
|
|
||||||
|
$inoid = encode_oid(split(/\./, ($oidnames{$inoidname} . ".$inoidport")));
|
||||||
|
$outoid = encode_oid(split(/\./, ($oidnames{$outoidname} . ".$outoidport")));
|
||||||
|
|
||||||
|
my @oids = ($inoid,$outoid);
|
||||||
|
|
||||||
|
if ($inoidname =~ /HC/i or $outoidname =~ /HC/i) {
|
||||||
|
$session = SNMPv2c_Session->open($host, $community, 161) or return "error";
|
||||||
|
} else {
|
||||||
|
$session = SNMP_Session->open($host, $community, 161) or return "error";
|
||||||
|
};
|
||||||
|
|
||||||
|
if ($session->get_request_response (@oids)) {
|
||||||
|
$response = $session->pdu_buffer;
|
||||||
|
($bindings) = $session->decode_get_response ($response);
|
||||||
|
|
||||||
|
while ($bindings ne '') {
|
||||||
|
($binding,$bindings) = decode_sequence ($bindings);
|
||||||
|
($oid,$value) = decode_by_template ($binding, "%O%@");
|
||||||
|
push (@results, pretty_print($value));
|
||||||
|
}
|
||||||
|
return @results;
|
||||||
|
} else { warn "SNMP Error: $SNMP_Session::errmsg\n";
|
||||||
|
return "error"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
sub snmpgetup {
|
||||||
|
my($host, $community, $inoid) = @_;
|
||||||
|
my($response, $bindings, $binding, $value, $oid, $result);
|
||||||
|
|
||||||
|
my %oidnames = qw(sysUpTime 1.3.6.1.2.1.1.3
|
||||||
|
sysUpTime.0 1.3.6.1.2.1.1.3.0);
|
||||||
|
|
||||||
|
$inoid = encode_oid(split(/\./, $oidnames{$inoid}));
|
||||||
|
|
||||||
|
my $session = SNMP_Session->open($host, $community, 161) or return "0";
|
||||||
|
|
||||||
|
if ($session->get_request_response ($inoid)) {
|
||||||
|
$response = $session->pdu_buffer;
|
||||||
|
($bindings) = $session->decode_get_response ($response);
|
||||||
|
|
||||||
|
while ($bindings ne '') {
|
||||||
|
($binding,$bindings) = decode_sequence ($bindings);
|
||||||
|
($oid,$value) = decode_by_template ($binding, "%O%@");
|
||||||
|
$result = pretty_print($value);
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
} else { warn "SNMP Error: $SNMP_Session::errmsg\n";
|
||||||
|
return 0; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
# Section personnalisée pour faire du SNMP en TCP.
|
||||||
|
# NS 22/02/03
|
||||||
|
#####################################################################################
|
||||||
|
sub snmpget2 {
|
||||||
|
my($host, $community, $inoid, $outoid) = @_;
|
||||||
|
|
||||||
|
open IN, "snmpget -T TCP $host $community interfaces.ifTable.ifEntry.$inoid |";
|
||||||
|
my $inresult = <IN>;
|
||||||
|
chomp($inresult);
|
||||||
|
close(IN);
|
||||||
|
|
||||||
|
open OUT, "snmpget -T TCP $host $community interfaces.ifTable.ifEntry.$outoid |";
|
||||||
|
my $outresult = <OUT>;
|
||||||
|
chomp($outresult);
|
||||||
|
close(OUT);
|
||||||
|
|
||||||
|
my @intable = split(/ /,$inresult );
|
||||||
|
my @outtable = split(/ /,$outresult );
|
||||||
|
|
||||||
|
my @results = ($intable[-1],$outtable[-1]);
|
||||||
|
|
||||||
|
return @results;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub snmpgetup2 {
|
||||||
|
my($host, $community, $upoid) = @_;
|
||||||
|
|
||||||
|
open UP, "snmpget -T TCP $host $community $upoid |";
|
||||||
|
my $uptimeresult = <UP>;
|
||||||
|
chomp($uptimeresult);
|
||||||
|
close(UP);
|
||||||
|
|
||||||
|
$uptimeresult =~ s/^.*\) //;
|
||||||
|
$uptimeresult =~ s/...$//;
|
||||||
|
|
||||||
|
return $uptimeresult;
|
||||||
|
}
|
||||||
|
####################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
sub chkuptime {
|
||||||
|
|
||||||
|
$_ =~ s/\[|\]//g;
|
||||||
|
my($uphost,$upip,$upcommunity,$upoid,$upfile) = split (/:/, $_);
|
||||||
|
my $upresult = snmpgetup2($upip,$upcommunity,$upoid);
|
||||||
|
|
||||||
|
tie(%inf, 'SDBM_File', ($upfile."$main::SL"."uptimes"), O_RDWR|O_CREAT, 0640)
|
||||||
|
or print "WARNING: Error opening uptime database file!\n";
|
||||||
|
|
||||||
|
if ($upresult < $inf{$uphost} && $upresult > "1") { $hostreset = "1"; }
|
||||||
|
else { $hostreset = "0"; }
|
||||||
|
|
||||||
|
if ($upresult > "1") { $inf{$uphost} = $upresult; }
|
||||||
|
|
||||||
|
untie(%inf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub main {
|
||||||
|
my($name,$host,$community,$inoid,$outoid,$path,$datafile) = @_;
|
||||||
|
|
||||||
|
tie(%inf, 'SDBM_File', ($path."$main::SL".$datafile), O_RDWR|O_CREAT, 0640) or
|
||||||
|
print "Error opening database file for $name at $host\n";
|
||||||
|
|
||||||
|
if (-s (($path."$main::SL".$datafile) . ".pag")) {
|
||||||
|
|
||||||
|
if ($inf{day} != $mday && $hour > "0") { newday();
|
||||||
|
dailyhtml($name,$host,$path); }
|
||||||
|
|
||||||
|
if ($inf{month} != $mon) {
|
||||||
|
$newmon = "1";
|
||||||
|
newday();
|
||||||
|
dailyhtml($name,$host,$path);
|
||||||
|
newmonth($name,$path);
|
||||||
|
monthlyhtml($name,$host,$path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inf{year} != ($year + "1900")) { newyear($name,$path); }
|
||||||
|
|
||||||
|
if (!$newmon) { updatedata(); }
|
||||||
|
|
||||||
|
if ($inf{day} != $mday) { $newday = "1"; } else { $newday = "0"; }
|
||||||
|
|
||||||
|
hourlyhtml($name,$host,$path,$newday);
|
||||||
|
|
||||||
|
} else { createdata(); hourlyhtml($name,$host,$path); }
|
||||||
|
|
||||||
|
untie(%inf);
|
||||||
|
}
|
||||||
|
|
||||||
|
# create data file if ! exist
|
||||||
|
#
|
||||||
|
|
||||||
|
sub createdata {
|
||||||
|
%inf = (lastin => $inoctets, lastout => $outoctets,
|
||||||
|
month => $mon, day => $mday, year => ($year + "1900"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
sub newyear {
|
||||||
|
|
||||||
|
my($name,$path) = @_;
|
||||||
|
my($count);
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
|
while ($count <= "11") {
|
||||||
|
delete $inf{"m" . $count};
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# move yearly html file.
|
||||||
|
|
||||||
|
$oldfile="$path"."$main::SL"."$name"."-months".".html";
|
||||||
|
$newfile="$path"."$main::SL"."$name"."-year".($year).".html";
|
||||||
|
|
||||||
|
if ($main::OS eq "NT") { system("move /Y $oldfile $newfile"); }
|
||||||
|
else { system("mv $oldfile $newfile"); }
|
||||||
|
|
||||||
|
$inf{year} = ($year + "1900");
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
sub newmonth {
|
||||||
|
|
||||||
|
my($name,$path) = @_;
|
||||||
|
my($count,$intotal,$outtotal,$inoct,$outoct);
|
||||||
|
|
||||||
|
# get MB total for the month and store it.
|
||||||
|
|
||||||
|
$count = 1;
|
||||||
|
while ($count <= "31") {
|
||||||
|
if ($inf{"d" . $count}) {
|
||||||
|
($inoct,$outoct) = split(/:/, $inf{"d" . $count});
|
||||||
|
$intotal += $inoct;
|
||||||
|
$outtotal += $outoct;
|
||||||
|
}
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$intotal = ($intotal / $mbsize);
|
||||||
|
$outtotal = ($outtotal / $mbsize);
|
||||||
|
|
||||||
|
$inf{"m" . $inf{month}} = "$intotal:$outtotal";
|
||||||
|
|
||||||
|
# clear days
|
||||||
|
|
||||||
|
$count = 1;
|
||||||
|
while ($count <= "31") {
|
||||||
|
delete $inf{"d" . $count};
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# move monthly html file.
|
||||||
|
|
||||||
|
$oldfile="$path"."$main::SL"."$name"."-days".".html";
|
||||||
|
$newfile="$path"."$main::SL"."$name"."-month".($mon).".html";
|
||||||
|
|
||||||
|
if ($main::OS eq "NT") { system("move /Y $oldfile $newfile"); }
|
||||||
|
else { system("mv $oldfile $newfile"); }
|
||||||
|
|
||||||
|
# set $inf{month} to the new month.
|
||||||
|
$inf{month} = $mon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# newday:
|
||||||
|
# run every time the day of the month changes on the system.
|
||||||
|
#
|
||||||
|
|
||||||
|
sub newday {
|
||||||
|
|
||||||
|
my($count,$nmday,$intotal,$outtotal,$inoct,$outoct);
|
||||||
|
|
||||||
|
# get megabyte total for the day and store it.
|
||||||
|
#
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
while ($count <= "23") {
|
||||||
|
if ($inf{$count}) {
|
||||||
|
($inoct,$outoct) = split(/:/, $inf{$count});
|
||||||
|
$intotal += $inoct;
|
||||||
|
$outtotal += $outoct;
|
||||||
|
}
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($newmon) { $nmday = last_mday($inf{month}, $inf{year}); }
|
||||||
|
else { $nmday = ($mday - 1); }
|
||||||
|
|
||||||
|
$inf{"d" . $nmday} = "$intotal:$outtotal:" . ($intotal + $outtotal);
|
||||||
|
|
||||||
|
# clear hours
|
||||||
|
#
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
while ($count <= "23") {
|
||||||
|
delete $inf{$count};
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$inf{day} = $mday;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# update DBM file.
|
||||||
|
#
|
||||||
|
|
||||||
|
sub updatedata {
|
||||||
|
my ($lasthour,$wrapin,$wrapout);
|
||||||
|
my $intwrap="4294967296";
|
||||||
|
|
||||||
|
if ($hour eq "0") { $lasthour = "23"; } else { $lasthour = ($hour - "1"); }
|
||||||
|
|
||||||
|
if ($hostreset == "1") { $inf{lastin} = $inf{lastout} = "0"; }
|
||||||
|
|
||||||
|
# detect if a counter has wrapped and adjust.
|
||||||
|
#
|
||||||
|
if ($inoctets < $inf{lastin}) {
|
||||||
|
$wrapin = $inoctets;
|
||||||
|
$inoctets = ($intwrap - $inf{lastin}) + $inoctets;
|
||||||
|
$inf{lastin} = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($outoctets < $inf{lastout}) {
|
||||||
|
$wrapout = $outoctets;
|
||||||
|
$outoctets = ($intwrap - $inf{lastout}) + $outoctets;
|
||||||
|
$inf{lastout} = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
$inf{$lasthour} = (($inoctets - $inf{lastin}).":".($outoctets - $inf{lastout}));
|
||||||
|
if ($wrapin) { $inf{lastin} = $wrapin } else { $inf{lastin} = $inoctets }
|
||||||
|
if ($wrapout) { $inf{lastout} = $wrapout } else { $inf{lastout} = $outoctets }
|
||||||
|
}
|
||||||
|
|
||||||
|
sub footer {
|
||||||
|
print DHTML "<br><br><br></td></tr></table><table cellpadding=3 align=left>
|
||||||
|
<tr><td><a href=http://www.dynw.com/iog/><img src=ioglogo.gif border=0></a></td>
|
||||||
|
<td>IOG $iogver - <a href=http://www.dynw.com/iog/>Input Output Grapher</a><br>
|
||||||
|
-<br>James Dogopoulos <<a href=mailto:jd\@dynw.com>jd\@dynw.com</a>><br>
|
||||||
|
Questions or comments to <a href=mailto:iog\@dynw.com>iog\@dynw.com</a>
|
||||||
|
</td></tr></table><br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
# make the hourly html
|
||||||
|
#
|
||||||
|
|
||||||
|
sub hourlyhtml {
|
||||||
|
|
||||||
|
my($name,$host,$path,$newday) = @_;
|
||||||
|
|
||||||
|
# make todays graph
|
||||||
|
#
|
||||||
|
|
||||||
|
my $enddays = last_mday($mon, ($year + "1900"));
|
||||||
|
|
||||||
|
my $count = "0";
|
||||||
|
my ($besthour,$bestday,$inoct,$outoct) = "0";
|
||||||
|
|
||||||
|
# find busiest hour
|
||||||
|
#
|
||||||
|
while ($count <= "23") {
|
||||||
|
if ($inf{$count}) { ($inoct,$outoct) = split(/:/, $inf{$count}); }
|
||||||
|
else { $inoct = $outoct = "0"; }
|
||||||
|
if ($inoct > $besthour) { $besthour = $inoct; }
|
||||||
|
if ($outoct > $besthour) { $besthour = $outoct; }
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $hscalemax = ($besthour / "1000000");
|
||||||
|
my ($hscaleunit,$intotal,$outtotal) = 0;
|
||||||
|
|
||||||
|
if ($hscalemax > "0") { $hscaleunit = ("450" / $hscalemax); }
|
||||||
|
|
||||||
|
open(DHTML, ">>$path".$main::SL."$name".".html") or print "can't open in $name $host $!";
|
||||||
|
flock(DHTML, 2) or print "can't flock $name $host: $!";
|
||||||
|
truncate(DHTML, 0);
|
||||||
|
|
||||||
|
print DHTML "<html><title>IOG $iogver - $host</title>
|
||||||
|
<META HTTP-EQUIV=Refresh CONTENT=3600><body bgcolor=#FFFFFF>
|
||||||
|
<table border=0><tr><td>";
|
||||||
|
|
||||||
|
my $dexist = (-f "$path".$main::SL."$name"."-days.html");
|
||||||
|
my $mexist = (-f "$path".$main::SL."$name"."-months.html");
|
||||||
|
|
||||||
|
if ($newday != "1") {
|
||||||
|
if ($dexist && $mexist) {
|
||||||
|
print DHTML "<font size=3> [ Today | <a href="."$name"."-days.html>This Month</a>
|
||||||
|
| <a href="."$name"."-months.html>Previous Months</a> ]</font><br><br>";
|
||||||
|
} else {
|
||||||
|
if ($dexist && !$mexist) {
|
||||||
|
print DHTML "<font size=3> [ Today | <a href="."$name"."-days.html>This
|
||||||
|
Month</a> | Previous Months ]</font><br><br>";
|
||||||
|
} else {
|
||||||
|
if (!$dexist && $mexist) {
|
||||||
|
print DHTML "<font size=3> [ Today | This Month
|
||||||
|
| <a href="."$name"."-months.html>Previous Months</a> ]</font><br><br>";
|
||||||
|
} else { print DHTML "[ Today | This Month | Previous Months ]"; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($dexist && $mexist) {
|
||||||
|
print DHTML "<font size=3> [ <a href="."$name"."-days.html>This Month</a>
|
||||||
|
| <a href="."$name"."-months.html>Previous Months</a> ]</font><br><br>";
|
||||||
|
} else {
|
||||||
|
if ($dexist && !$mexist) {
|
||||||
|
print DHTML "<font size=3> [ <a href="."$name"."-days.html>This
|
||||||
|
Month</a> | Previous Months ]</font><br><br>";
|
||||||
|
} else {
|
||||||
|
if (!$dexist && $mexist) {
|
||||||
|
print DHTML "<font size=3> [ This Month
|
||||||
|
| <a href="."$name"."-months.html>Previous Months</a> ]</font><br><br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($newday eq "1") { $tday = "$nday"; } else { $tday = "$pday"; }
|
||||||
|
|
||||||
|
print DHTML "<h3>$months[$mon] $tday - Network I/O for $name ($host)</h3>";
|
||||||
|
print DHTML "<table cellpadding=5 border=1>";
|
||||||
|
|
||||||
|
$count = "0";
|
||||||
|
|
||||||
|
while ($count <= "23") {
|
||||||
|
my($inwidth,$outwidth);
|
||||||
|
|
||||||
|
if ($inf{$count}) {
|
||||||
|
($inoct,$outoct) = split(/:/, $inf{$count});
|
||||||
|
$intotal += $inoct;
|
||||||
|
$outtotal += $outoct;
|
||||||
|
$inwidth = ($inoct / "1000000" * $hscaleunit);
|
||||||
|
$outwidth = ($outoct / "1000000" * $hscaleunit);
|
||||||
|
} else { $count++; next; }
|
||||||
|
|
||||||
|
# if day is over 1gb, switch to GB/MB display.
|
||||||
|
#
|
||||||
|
my($gstring,$gbin,$gbout,$mbin,$mbout);
|
||||||
|
|
||||||
|
$mbin = sprintf("%.1f", $inoct / $mbsize);
|
||||||
|
$mbout = sprintf("%.1f", $outoct / $mbsize);
|
||||||
|
|
||||||
|
if ($mbin > $gbsize or $mbout > $gbsize) {
|
||||||
|
$gbin = sprintf("%.1f", $mbin / $gbsize);
|
||||||
|
$gbout = sprintf("%.1f", $mbout / $gbsize);
|
||||||
|
|
||||||
|
$gstring = "<td><font size=2><font color=#00CC00>In:</font> $gbin GB
|
||||||
|
($mbin MB)<br><font color=#0000FF>Out:</font> $gbout GB ($mbout MB)
|
||||||
|
</font></td></tr>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$gstring = "<td><font size=2><font color=#00CC00>In:</font> $mbin MB (".
|
||||||
|
sprintf("%.f", $inoct / $kbsize)." KB)<br><font color=#0000FF>Out:</font> $mbout
|
||||||
|
MB (".sprintf("%.f", $outoct / $kbsize)." KB)";
|
||||||
|
}
|
||||||
|
|
||||||
|
$inwidth = (sprintf("%.f", $inwidth) + 1);
|
||||||
|
$outwidth = (sprintf("%.f", $outwidth) + 1);
|
||||||
|
|
||||||
|
print DHTML "<tr><td><b>"."$count".":00</b></td><td width=455><img src=in.gif height=12 width=$inwidth><br>\n";
|
||||||
|
print DHTML "<img src=out.gif height=12 width=$outwidth><br></td>\n";
|
||||||
|
|
||||||
|
print DHTML $gstring;
|
||||||
|
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$intotal = sprintf("%.f", ($intotal / $mbsize));
|
||||||
|
$outtotal = sprintf("%.f", ($outtotal / $mbsize));
|
||||||
|
|
||||||
|
print DHTML "</table><br></td></tr><tr><td align=right>";
|
||||||
|
|
||||||
|
if ($intotal > $gbsize or $outtotal > $gbsize) {
|
||||||
|
my $gbtotal = sprintf("%.1f", ($intotal + $outtotal) / $gbsize);
|
||||||
|
print DHTML "Today's Total: <b>$gbtotal GB</b><br><font color=#00CC00>
|
||||||
|
In:</font> $intotal MB - <font color=#0000FF>Out:</font>
|
||||||
|
$outtotal MB<br>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print DHTML "Today's Total: <b>".($intotal + $outtotal)." MB</b><br>
|
||||||
|
<font color=#00CC00>In:</font> $intotal MB - <font color=#0000FF>Out:</font>
|
||||||
|
$outtotal MB<br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
footer();
|
||||||
|
|
||||||
|
flock(DHTML, 8);
|
||||||
|
close(DHTML);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub monthlyhtml {
|
||||||
|
|
||||||
|
my ($name,$host,$path) = @_;
|
||||||
|
my ($bestmonth,$m_intotal,$m_outtotal,$m_total);
|
||||||
|
my $count = 0;
|
||||||
|
|
||||||
|
# find busiest month
|
||||||
|
|
||||||
|
while ($count <= "11") {
|
||||||
|
if ($inf{"m" . $count}) {
|
||||||
|
($m_intotal,$m_outtotal) = split(/:/, $inf{"m" . $count});
|
||||||
|
if ($m_intotal > $bestmonth) { $bestmonth = $m_intotal; }
|
||||||
|
if ($m_outtotal > $bestmonth) { $bestmonth = $m_outtotal; }
|
||||||
|
}
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $mscalemax = $bestmonth;
|
||||||
|
my ($mscaleunit,$intotal,$outtotal) = 0;
|
||||||
|
|
||||||
|
if ($mscalemax > "0") { $mscaleunit = ("450" / $mscalemax); }
|
||||||
|
|
||||||
|
open(DHTML, ">>$path".$main::SL."$name"."-months.html") or print "can't open $name $host $!";
|
||||||
|
flock(DHTML, 2) or print "can't flock $name $host : $!";
|
||||||
|
truncate(DHTML, 0);
|
||||||
|
|
||||||
|
print DHTML "<html><title>IOG $iogver - $host</title><body bgcolor=#FFFFFF>
|
||||||
|
<table border=0><tr><td>";
|
||||||
|
|
||||||
|
my $dexist = (-f "$path".$main::SL."$name"."-days.html");
|
||||||
|
|
||||||
|
if ($dexist) {
|
||||||
|
print DHTML "<font size=3>[ <a href="."$name".".html>Today</a> |
|
||||||
|
<a href="."$name"."-days.html>This Month</a> | Previous Months ]</font><br><br>";
|
||||||
|
} else {
|
||||||
|
print DHTML "<font size=3>[ <a href="."$name".".html>Today</a> |
|
||||||
|
This Month | Previous Months ]</font><br><br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print DHTML "<h3>Monthly Network I/O for $name ($host)</h3>";
|
||||||
|
print DHTML "<table cellpadding=5 border=1>";
|
||||||
|
|
||||||
|
$count = "0";
|
||||||
|
|
||||||
|
while ($count <= "11") {
|
||||||
|
my($inwidth,$outwidth,$intotal,$outtotal,$inoct,$outoct,$mtotal);
|
||||||
|
|
||||||
|
if ($inf{"m" . $count}) {
|
||||||
|
($inoct,$outoct,$mtotal) = split(/:/, $inf{"m" . $count});
|
||||||
|
$intotal += $inoct;
|
||||||
|
$outtotal += $outoct;
|
||||||
|
$inwidth = ($inoct * $mscaleunit);
|
||||||
|
$outwidth = ($outoct * $mscaleunit);
|
||||||
|
} else { $count++; next; }
|
||||||
|
|
||||||
|
# if day is over 1gb, switch to GB/MB display.
|
||||||
|
#
|
||||||
|
my($gstring,$gbin,$gbout,$gbtotal,$mbin,$mbout);
|
||||||
|
|
||||||
|
$mbin = sprintf("%.f", $inoct);
|
||||||
|
$mbout = sprintf("%.f", $outoct);
|
||||||
|
|
||||||
|
$gbin = sprintf("%.1f", $mbin / $gbsize);
|
||||||
|
$gbout = sprintf("%.1f", $mbout / $gbsize);
|
||||||
|
$gbtotal = sprintf("%.1f", ($gbin + $gbout));
|
||||||
|
|
||||||
|
$gstring = "<td><font size=2><font color=#00CC00>In:</font> $gbin GB
|
||||||
|
($mbin MB)<br><font color=#0000FF>Out:</font> $gbout GB ($mbout MB)
|
||||||
|
</font></td></tr>";
|
||||||
|
|
||||||
|
$inwidth = (sprintf("%.f", $inwidth) + 1);
|
||||||
|
$outwidth = (sprintf("%.f", $outwidth) + 1);
|
||||||
|
|
||||||
|
if (-f "$path".$main::SL."$name"."-month".($count + "1").".html") {
|
||||||
|
$mlink = "<a href=$name"."-month".($count + "1").".html>$months[$count]</a>";
|
||||||
|
} else { $mlink = "$months[$count]"; }
|
||||||
|
|
||||||
|
print DHTML "<tr><td><b>$mlink<br>$gbtotal GB</b></td><td width=455>
|
||||||
|
<img src=in.gif height=12 width=$inwidth><br>\n";
|
||||||
|
print DHTML "<img src=out.gif height=12 width=$outwidth><br></td>\n";
|
||||||
|
|
||||||
|
print DHTML $gstring;
|
||||||
|
|
||||||
|
$count++
|
||||||
|
}
|
||||||
|
|
||||||
|
print DHTML "</tr></td></table><br>";
|
||||||
|
|
||||||
|
footer();
|
||||||
|
|
||||||
|
flock(DHTML, 8);
|
||||||
|
close(DHTML);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub dailyhtml {
|
||||||
|
|
||||||
|
my ($bestday,$d_intotal,$d_outtotal) = 0;
|
||||||
|
my ($name,$host,$path) = @_;
|
||||||
|
my $count = 1;
|
||||||
|
my $endday = last_mday($inf{month}, $inf{year});
|
||||||
|
|
||||||
|
if ($endday eq $mday) { $lastday="1"; } else { $lastday="0"; }
|
||||||
|
|
||||||
|
# fix math errors from previous sub
|
||||||
|
if ($newmon) { $mon--; }
|
||||||
|
|
||||||
|
# move Today's html file unless it's a new month.
|
||||||
|
|
||||||
|
if (!$newmon) {
|
||||||
|
$oldfile="$path"."$main::SL"."$name".".html";
|
||||||
|
$newfile="$path"."$main::SL"."$name"."-day".($mday - "1").".html";
|
||||||
|
if ($main::OS eq "NT") { system("move /Y $oldfile $newfile"); }
|
||||||
|
else { system("mv $oldfile $newfile"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
# find busiest day (should be merged with totals)
|
||||||
|
|
||||||
|
while ($count <= $endday) {
|
||||||
|
if ($inf{"d" . $count}) {
|
||||||
|
($d_intotal,$d_outtotal) = split(/:/, $inf{"d" . $count});
|
||||||
|
if ($d_intotal > $bestday) { $bestday = $d_intotal; }
|
||||||
|
if ($d_outtotal > $bestday) { $bestday = $d_outtotal; }
|
||||||
|
}
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $dscalemax = ($bestday / "1000000");
|
||||||
|
my ($dscaleunit,$intotal,$outtotal) = 0;
|
||||||
|
|
||||||
|
if ($dscalemax > "0") { $dscaleunit = ("450" / $dscalemax); }
|
||||||
|
|
||||||
|
open(DHTML, ">>$path".$main::SL."$name"."-days.html") or print "can't open $name $host $!";
|
||||||
|
flock(DHTML, 2) or print "can't flock $name $host : $!";
|
||||||
|
truncate(DHTML, 0);
|
||||||
|
|
||||||
|
print DHTML "<html><title>IOG $iogver - $host</title><body bgcolor=#FFFFFF>
|
||||||
|
<table border=0><tr><td>";
|
||||||
|
|
||||||
|
if (-f "$path".$main::SL."$name"."-months.html") {
|
||||||
|
print DHTML "<font size=3>[ <a href="."$name".".html>Today</a> |
|
||||||
|
This Month | <a href="."$name"."-months.html>Previous Months</a> ]</font><br><br>";
|
||||||
|
} else {
|
||||||
|
print DHTML "<font size=3>[ <a href="."$name".".html>Today</a> | This Month
|
||||||
|
| Previous Months ]</font><br><br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print DHTML "<h3>$months[$mon] - Network I/O for $name ($host)</h3>";
|
||||||
|
print DHTML "<table cellpadding=5 border=1>";
|
||||||
|
|
||||||
|
$count = "1";
|
||||||
|
|
||||||
|
while ($count <= $endday) {
|
||||||
|
my($inwidth,$outwidth,$inoct,$outoct,$pday);
|
||||||
|
|
||||||
|
if ($inf{"d" . $count}) {
|
||||||
|
($inoct,$outoct) = split(/:/, $inf{"d" . $count});
|
||||||
|
$intotal += $inoct;
|
||||||
|
$outtotal += $outoct;
|
||||||
|
$inwidth = ($inoct / "1000000" * $dscaleunit);
|
||||||
|
$outwidth = ($outoct / "1000000" * $dscaleunit);
|
||||||
|
} else { $count++; next; }
|
||||||
|
|
||||||
|
# if day is over 1gb, switch to GB/MB display.
|
||||||
|
#
|
||||||
|
my($gstring,$gbin,$gbout,$mbin,$mbout);
|
||||||
|
|
||||||
|
$mbin = sprintf("%.f", $inoct / $mbsize);
|
||||||
|
$mbout = sprintf("%.f", $outoct / $mbsize);
|
||||||
|
|
||||||
|
if ($mbin > $gbsize or $mbout > $gbsize) {
|
||||||
|
$gbin = sprintf("%.1f", $mbin / $gbsize);
|
||||||
|
$gbout = sprintf("%.1f", $mbout / $gbsize);
|
||||||
|
|
||||||
|
$gstring = "<td><font size=2><font color=#00CC00>In:</font> $gbin GB
|
||||||
|
($mbin MB)<br><font color=#0000FF>Out:</font> $gbout GB ($mbout MB)
|
||||||
|
</font></td></tr>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$gstring = "<td><font size=2><font color=#00CC00>In:</font> $mbin MB (".
|
||||||
|
sprintf("%.f", $inoct / $kbsize)." KB)<br><font color=#0000FF>Out:</font> $mbout
|
||||||
|
MB (".sprintf("%.f", $outoct / $kbsize)." KB)";
|
||||||
|
}
|
||||||
|
|
||||||
|
$inwidth = (sprintf("%.f", $inwidth) + 1);
|
||||||
|
$outwidth = (sprintf("%.f", $outwidth) + 1);
|
||||||
|
|
||||||
|
if ($days{$count}) { $pday = $days{$count}; } else { $pday = $count."th"; }
|
||||||
|
|
||||||
|
if (-f "$path".$main::SL."$name"."-day".$count.".html" && $lastday eq "0"
|
||||||
|
&& ($newmon ne "1")) {
|
||||||
|
$pday = "<a href=$name"."-day".$count.".html>$pday</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print DHTML "<tr><td><b>$pday</b></td><td width=455>
|
||||||
|
<img src=in.gif height=12 width=$inwidth><br>\n";
|
||||||
|
print DHTML "<img src=out.gif height=12 width=$outwidth><br></td>\n";
|
||||||
|
print DHTML $gstring;
|
||||||
|
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$intotal = sprintf("%.f", ($intotal / $mbsize));
|
||||||
|
$outtotal = sprintf("%.f", ($outtotal / $mbsize));
|
||||||
|
|
||||||
|
my $gbtotal = sprintf("%.1f", (($intotal + $outtotal) / $gbsize));
|
||||||
|
|
||||||
|
print DHTML "</table><br></td></tr><tr><td align=right>";
|
||||||
|
print DHTML "Monthly Total: <b>$gbtotal GB</b><br><font color=#00CC00>
|
||||||
|
In:</font> $intotal MB - <font color=#0000FF>Out:</font> $outtotal MB<br>";
|
||||||
|
|
||||||
|
footer();
|
||||||
|
|
||||||
|
flock(DHTML, 8);
|
||||||
|
close(DHTML);
|
||||||
|
|
||||||
|
# reverse math errors
|
||||||
|
if ($newmon) { $mon++; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# IOG v1.0 - Input/Output Grapher
|
||||||
|
# Copyright 2000-2002 (c) James Dogopoulos
|
||||||
|
#
|
||||||
|
|
||||||
|
|
11
archive/archives/spamassassin-anti-block
Executable file
11
archive/archives/spamassassin-anti-block
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
MBOX=/var/tmp/mbox
|
||||||
|
TMP=$(mktemp)
|
||||||
|
spamc -t 60 < $MBOX > $TMP
|
||||||
|
if diff $TMP $MBOX > /dev/null; then
|
||||||
|
/etc/init.d/spamassassin restart
|
||||||
|
echo "Spam Assassin a été relancé." | mail roots@crans.org -s "Spam Assassin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $TMP
|
26
archive/archives/squid-vit-il
Executable file
26
archive/archives/squid-vit-il
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- Python -*-
|
||||||
|
|
||||||
|
# teste si notre squid fonctionne encore (sortof).
|
||||||
|
|
||||||
|
from socket import *
|
||||||
|
import sys
|
||||||
|
|
||||||
|
OK = 0
|
||||||
|
|
||||||
|
host = "localhost"
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
host = sys.argv[1]
|
||||||
|
|
||||||
|
s = socket(AF_INET,SOCK_STREAM)
|
||||||
|
try:
|
||||||
|
s.connect(host,3128)
|
||||||
|
s.send("GET squid-vit-il")
|
||||||
|
data = s.recv(4)
|
||||||
|
OK = ("HTTP" == data)
|
||||||
|
s.close()
|
||||||
|
except:
|
||||||
|
OK = 0
|
||||||
|
|
||||||
|
sys.exit(not OK)
|
||||||
|
|
19
archive/archives/supers/apt-get
Executable file
19
archive/archives/supers/apt-get
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
# juste etendre le path, et lancer le prog
|
||||||
|
# /supers n'est plus ds le path,
|
||||||
|
# donc 'exec prog' lance le vrai prog.
|
||||||
|
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
|
exec $prog ${1+"$@"}
|
13
archive/archives/supers/apt-getinstall
Executable file
13
archive/archives/supers/apt-getinstall
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
#Attention: pour lanceMake, il faut explicitement donné les options
|
||||||
|
# à make, sinon en passant "-f /home/bidule/Makefile", a super make,
|
||||||
|
# tout serait faisable en root..
|
||||||
|
prog=`basename $0`
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"}
|
||||||
|
PATH=/usr/sbin:/sbin:$PATH
|
||||||
|
|
||||||
|
/usr/bin/apt-get install ${1+"$@"}
|
14
archive/archives/supers/apt-getupgrade
Executable file
14
archive/archives/supers/apt-getupgrade
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
#Attention: pour lanceMake, il faut explicitement donné les options
|
||||||
|
# à make, sinon en passant "-f /home/bidule/Makefile", a super make,
|
||||||
|
# tout serait faisable en root..
|
||||||
|
prog=`basename $0`
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"}
|
||||||
|
PATH=/usr/sbin:/sbin:$PATH
|
||||||
|
|
||||||
|
/usr/bin/apt-get update
|
||||||
|
/usr/bin/apt-get dist-upgrade ${1+"$@"}
|
19
archive/archives/supers/aptitude
Executable file
19
archive/archives/supers/aptitude
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
# juste etendre le path, et lancer le prog
|
||||||
|
# /supers n'est plus ds le path,
|
||||||
|
# donc 'exec prog' lance le vrai prog.
|
||||||
|
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
|
exec $prog ${1+"$@"}
|
20
archive/archives/supers/chowncore
Executable file
20
archive/archives/supers/chowncore
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
|
||||||
|
coreF=$ORIG_HOME/debug/
|
||||||
|
chown -R $ORIG_LOGNAME $coreF && echo "chown debug dir DONE."
|
||||||
|
|
||||||
|
|
||||||
|
|
19
archive/archives/supers/dpkg
Executable file
19
archive/archives/supers/dpkg
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
# juste etendre le path, et lancer le prog
|
||||||
|
# /supers n'est plus ds le path,
|
||||||
|
# donc 'exec prog' lance le vrai prog.
|
||||||
|
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
|
exec $prog ${1+"$@"}
|
30
archive/archives/supers/etccommit
Executable file
30
archive/archives/supers/etccommit
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
prog=`basename $0`
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
USER=$ORIG_USER
|
||||||
|
USERNAME=$USER
|
||||||
|
LOGNAME=$ORIG_LOGNAME
|
||||||
|
|
||||||
|
cur=$(pwd)
|
||||||
|
echo $cur
|
||||||
|
if test "X${cur//etc/TOTO}" = "X$cur" && test "X${cur//scripts/TOTO}" = "X$cur";
|
||||||
|
then #il ya pas 'etc' ou 'scripts' ds le rep courant.
|
||||||
|
echo switching dir to /etc
|
||||||
|
cd /etc
|
||||||
|
fi
|
||||||
|
|
||||||
|
#echo "logname : " $LOGNAME
|
||||||
|
echo "who am i :" `who am i`
|
||||||
|
# en fait j'ai l'impression que ttes les variables sont ignorées par cvs.
|
||||||
|
# qd on est root, il récupere le vrai user par "who am i", ie par le owner du TTY..
|
||||||
|
/usr/bin/cvs -q -d /usr/cvs-rep commit ${1+"$@"}
|
||||||
|
|
19
archive/archives/supers/extendPath
Executable file
19
archive/archives/supers/extendPath
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
# juste etendre le path, et lancer le prog
|
||||||
|
# /supers n'est plus ds le path,
|
||||||
|
# donc 'exec prog' lance le vrai prog.
|
||||||
|
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
|
exec $prog ${1+"$@"}
|
21
archive/archives/supers/hide/less
Executable file
21
archive/archives/supers/hide/less
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, déc 99
|
||||||
|
# magie: le script lance super sur son propre nom
|
||||||
|
# et ca lance le bon programme..
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
|
||||||
|
# Si le script courant est lancé par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on éxécute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
test "X$SUPERCMD" = "X$prog" || test "X$UID" = "X0" ||
|
||||||
|
exec /usr/bin/super $prog ${1+"$@"} # le script s'arrete ici ds ce cas.
|
||||||
|
|
||||||
|
# Contenu du script :
|
||||||
|
|
||||||
|
if test "X$UID" = "X0"; then
|
||||||
|
echo "uid=root. setting LESSSECURE=1. "
|
||||||
|
export LESSSECURE=1
|
||||||
|
export LANG=fr_FR # c'est chiant less en locale=C ..
|
||||||
|
exec /usr/bin/less ${1+"$@"}
|
||||||
|
fi
|
25
archive/archives/supers/id/apache-ssl
Executable file
25
archive/archives/supers/id/apache-ssl
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/arp
Executable file
25
archive/archives/supers/id/arp
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/arpd
Executable file
25
archive/archives/supers/id/arpd
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/arpwatch
Executable file
25
archive/archives/supers/id/arpwatch
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/bind
Executable file
25
archive/archives/supers/id/bind
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/bootmisc.sh
Executable file
25
archive/archives/supers/id/bootmisc.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/checkfs.sh
Executable file
25
archive/archives/supers/id/checkfs.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/checkroot.sh
Executable file
25
archive/archives/supers/id/checkroot.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/console-screen.kbd.sh
Executable file
25
archive/archives/supers/id/console-screen.kbd.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/console-screen.sh
Executable file
25
archive/archives/supers/id/console-screen.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/cron
Executable file
25
archive/archives/supers/id/cron
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/cucipop
Executable file
25
archive/archives/supers/id/cucipop
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/devpts.sh
Executable file
25
archive/archives/supers/id/devpts.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/devpts.sh.dpkg-old
Executable file
25
archive/archives/supers/id/devpts.sh.dpkg-old
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/dhcp
Executable file
25
archive/archives/supers/id/dhcp
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/dhcp.dpkg-dist
Executable file
25
archive/archives/supers/id/dhcp.dpkg-dist
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/dns-clean
Executable file
25
archive/archives/supers/id/dns-clean
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/exim
Executable file
25
archive/archives/supers/id/exim
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/firewall
Executable file
25
archive/archives/supers/id/firewall
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/gnu-pop3d
Executable file
25
archive/archives/supers/id/gnu-pop3d
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/halt
Executable file
25
archive/archives/supers/id/halt
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/hdSettings
Executable file
25
archive/archives/supers/id/hdSettings
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/hostname.sh
Executable file
25
archive/archives/supers/id/hostname.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/hwclock.sh
Executable file
25
archive/archives/supers/id/hwclock.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/inetd
Executable file
25
archive/archives/supers/id/inetd
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/inn2
Executable file
25
archive/archives/supers/id/inn2
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/isapnp
Executable file
25
archive/archives/supers/id/isapnp
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/kerneld
Executable file
25
archive/archives/supers/id/kerneld
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/keymaps-lct.sh
Executable file
25
archive/archives/supers/id/keymaps-lct.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/keymaps.sh
Executable file
25
archive/archives/supers/id/keymaps.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/logoutd
Executable file
25
archive/archives/supers/id/logoutd
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/lpd
Executable file
25
archive/archives/supers/id/lpd
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/makedev
Executable file
25
archive/archives/supers/id/makedev
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/modutils
Executable file
25
archive/archives/supers/id/modutils
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/mountall.sh
Executable file
25
archive/archives/supers/id/mountall.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/mountnfs.sh
Executable file
25
archive/archives/supers/id/mountnfs.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/netbase.old
Executable file
25
archive/archives/supers/id/netbase.old
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/network
Executable file
25
archive/archives/supers/id/network
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/network2
Executable file
25
archive/archives/supers/id/network2
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/networking
Executable file
25
archive/archives/supers/id/networking
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/ntp
Executable file
25
archive/archives/supers/id/ntp
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/ntpdate
Executable file
25
archive/archives/supers/id/ntpdate
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/portmap
Executable file
25
archive/archives/supers/id/portmap
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/postfix
Executable file
25
archive/archives/supers/id/postfix
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/ppp
Executable file
25
archive/archives/supers/id/ppp
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/procps.sh
Executable file
25
archive/archives/supers/id/procps.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/rc
Executable file
25
archive/archives/supers/id/rc
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/rcS
Executable file
25
archive/archives/supers/id/rcS
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
25
archive/archives/supers/id/reboot
Executable file
25
archive/archives/supers/id/reboot
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Sam K, Jan 2000
|
||||||
|
# sert Doublement de wrapper:
|
||||||
|
# d'abord autolance super sur /id/(basename $0),
|
||||||
|
# Et aussi, qd appelé via super, lance un scipt de /id en modifiant le apth au prealable.
|
||||||
|
|
||||||
|
prog=`basename $0`
|
||||||
|
supcmd=`basename ${SUPERCMD=_NILL_}`
|
||||||
|
|
||||||
|
# Si le script courant est lanc<E9> par super, $SUPERCMD permet de le voir.
|
||||||
|
# et alors on continue gentiment le script, sinon on <E9>x<E9>cute super sur le prog.
|
||||||
|
# ca permet de faire des scripts qui lancent super sur eux-memes..
|
||||||
|
if ! test "X$supcmd" = "X$prog"; then
|
||||||
|
echo "calling super, $supcmd $prog"
|
||||||
|
exec /usr/bin/super /id/$prog ${1+"$@"}
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Si le script continue, c'est qu'on est lancé par super.
|
||||||
|
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/usr/bin:$PATH
|
||||||
|
|
||||||
|
echo "Path set to: $PATH by id_wrapper"
|
||||||
|
exec /etc/init.d/$prog ${1+"$@"}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue