[Ménage] On déplace tout ce qui est apparemment inutile et inutilisé dans /usr/scripts/archive en préservant l'arborescence
Ignore-this: 8d1754ffb1590f21db6c935f0a2299bd Si des trucs ne marchent plus, faites des mv ! darcs-hash:20130118003531-afe24-59a0c8a1afc71c24c43466952f636081895194d3.gz
This commit is contained in:
parent
61c8c705ce
commit
0388831524
13 changed files with 1 additions and 1006 deletions
|
@ -1,14 +0,0 @@
|
||||||
/!\ Ce mail est une réponse automatique !
|
|
||||||
|
|
||||||
Bonjour,
|
|
||||||
|
|
||||||
Suite à un changement d'organisation, l'adresse à laquelle vous venez
|
|
||||||
d'envoyer un mail (batX@crans.org) n'est plus valide. Si vous souhaitez
|
|
||||||
rencontrer un câbleur, vous pouvez aller à la Kfet lors des permanences
|
|
||||||
effectuées par ceux-ci ; sinon, vous pouvez aussi les contacter comme
|
|
||||||
indiqué sur la page <http://www.crans.org/contact/contactcrans.html>.
|
|
||||||
|
|
||||||
Désolé pour le désagrément rencontré.
|
|
||||||
|
|
||||||
--
|
|
||||||
Les responsables bâtiments
|
|
|
@ -1,35 +0,0 @@
|
||||||
# Repondeur automatique pour batX et all-bureau
|
|
||||||
# 14/09/2004 version 1 Benoit R.
|
|
||||||
|
|
||||||
# Pour vérifier que ca marche bien
|
|
||||||
VERBOSE=no
|
|
||||||
LOGFILE=/var/tmp/autoreply-procmail.log
|
|
||||||
|
|
||||||
# Pour éviter les doublons (spams ou boulets qui envoient à tous les batX)
|
|
||||||
:0 Wh: msgid.lock
|
|
||||||
|formail -D 8192 /var/tmp/autoreply-msgid.cache
|
|
||||||
|
|
||||||
# On pipe par le client de spamassassin
|
|
||||||
:0 Whbf
|
|
||||||
* < 256000
|
|
||||||
| spamc
|
|
||||||
|
|
||||||
# rejet du spam :
|
|
||||||
:0 :
|
|
||||||
* ^X-Spam-Status: Yes
|
|
||||||
/dev/null
|
|
||||||
:0 :
|
|
||||||
* ^X-Reject: 554
|
|
||||||
/dev/null
|
|
||||||
|
|
||||||
# ne réponds pas au mailings-lists et démons :
|
|
||||||
# et pas de boucles :
|
|
||||||
:0 h
|
|
||||||
* !^FROM_DAEMON
|
|
||||||
* !^X-Loop: batX@crans.org
|
|
||||||
|(formail -r -I "From: nobody@crans.org" \
|
|
||||||
-A "X-Loop: batX@crans.org" ;\
|
|
||||||
cat /usr/scripts/auto-reply/mailbatX)| /usr/sbin/sendmail -oi -t
|
|
||||||
|
|
||||||
:0
|
|
||||||
/dev/null
|
|
|
@ -1,197 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
#
|
|
||||||
# Script de mise à jour automatique du FTP public du Cr@ns.
|
|
||||||
#
|
|
||||||
# Copyright (C) Augustin Parret-Fréaud
|
|
||||||
# Licence : GPLv2
|
|
||||||
#
|
|
||||||
|
|
||||||
# TODO : * creer un fichier de logs journalier (modifier la config de rsync
|
|
||||||
# devrait suffire)
|
|
||||||
# * intéger Chronomium, Dynebolic et Kaella (ie. trouver un
|
|
||||||
# serveur rsync qui le fasse ou utiliser autre chose (ftpmirror ?)
|
|
||||||
|
|
||||||
# Chemin du FTP
|
|
||||||
PATHFTP="/pubftp/august/"
|
|
||||||
|
|
||||||
# Distributions à gérer (nb : le nom du répertoire doit être
|
|
||||||
# le même que celui indiqué dans la liste ci-après).
|
|
||||||
# Debian, Fedora, Gentoo, Knoppix, Ubuntu
|
|
||||||
DISTRIB="Knoppix"
|
|
||||||
#DISTRIB="Debian Fedora Gentoo Knoppix Ubuntu"
|
|
||||||
|
|
||||||
# Variables diverses
|
|
||||||
LOGFILE="sync-ftp.log"
|
|
||||||
LOGRSYNC="/localhome/parret-freaud/log/rsync"
|
|
||||||
LOGTEMP="/localhome/parret-freaud/log/temp"
|
|
||||||
LOGMAIL="/localhome/parret-freaud/log/mail"
|
|
||||||
RSYNCOPT="--recursive --links --hard-links --times --verbose --delete-after"
|
|
||||||
ENTMAIL1="Liste des fichiers mis à jour sur le ftp public\n\
|
|
||||||
===============================================\n\n"
|
|
||||||
ENTMAIL3="-- \nMessage généré par sync-ftp.sh"
|
|
||||||
|
|
||||||
# Fichiers en écriture pour le groupe (ça ne fonctionne pas, à creuser ...)
|
|
||||||
cd $PATHFTP
|
|
||||||
umask 002
|
|
||||||
|
|
||||||
# Boucle principale
|
|
||||||
|
|
||||||
echo -e $ENTMAIL1 > $LOGMAIL
|
|
||||||
|
|
||||||
for DIST in $DISTRIB; do
|
|
||||||
|
|
||||||
case $DIST in
|
|
||||||
|
|
||||||
Debian)
|
|
||||||
# Adresse du miroir
|
|
||||||
MIRROR="rsync://ftp.de.debian.org/debian-cd"
|
|
||||||
# Architectures à exclure (à choisir parmi :
|
|
||||||
# alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc)
|
|
||||||
ARCH_EXCLUDE="alpha arm hppa ia64 m68k mips mipsel s390"
|
|
||||||
# Fichiers/repertoires à exclude pour ces architectures
|
|
||||||
# de la forme "--exclude foo1$ARCH/ --exclude foo2$ARCH/ ... "
|
|
||||||
#ARCH_FR_EXCL="--exclude ${ARCH} "
|
|
||||||
# Exclusions supplémentaires
|
|
||||||
EXCLUDE="--exclude project --exclude bt-cd --exclude jigdo-cd \
|
|
||||||
--exclude jigdo-dvd --exclude bt-dvd --exclude source \
|
|
||||||
--exclude HEADER.html --exclude trace --exclude mkimage.log "
|
|
||||||
# A virer une fois les tests finis
|
|
||||||
for ARCH in $ARCH_EXCLUDE; do
|
|
||||||
EXCLUDE=$EXCLUDE"--exclude $ARCH "
|
|
||||||
done
|
|
||||||
PATHLOCAL=$PATHFTP"$DIST/"
|
|
||||||
ENTMAIL2="$DIST ($PATHLOCAL)\n======\n"
|
|
||||||
TAIL=15 # Pour le formattage du mail
|
|
||||||
;;
|
|
||||||
|
|
||||||
Fedora)
|
|
||||||
# Adresse du miroir
|
|
||||||
MIRROR="rsync://ftp.uvsq.fr/fedora/"
|
|
||||||
# Architectures à exclure (à choisir parmi :
|
|
||||||
# i386, x86-64)
|
|
||||||
ARCH_EXCLUDE=""
|
|
||||||
# Exclusions supplémentaires
|
|
||||||
EXCLUDE="--exclude development --exclude test --exclude updates \
|
|
||||||
--exclude source --exclude debug --exclude os --exclude SRPMS \
|
|
||||||
--exclude *-rescuecd.iso --exclude *-disc* "
|
|
||||||
for ARCH in $ARCH_EXCLUDE; do
|
|
||||||
EXCLUDE=$EXCLUDE"--exclude $ARCH "
|
|
||||||
done
|
|
||||||
PATHLOCAL=$PATHFTP"$DIST/"
|
|
||||||
ENTMAIL2="$DIST ($PATHLOCAL)\n======\n"
|
|
||||||
TAIL=3
|
|
||||||
;;
|
|
||||||
|
|
||||||
Gentoo)
|
|
||||||
# Adresse du miroir
|
|
||||||
MIRROR="rsync://ftp.belnet.be/gentoo/releases/"
|
|
||||||
# Architectures à exclure (à choisir parmi :
|
|
||||||
# alpha, amd64, hppa, ia64, ppc, ppc64, sparc, x86)
|
|
||||||
ARCH_EXCLUDE="alpha hppa ia64 ppc ppc64 sparc"
|
|
||||||
# Exclusions supplémentaires
|
|
||||||
EXCLUDE="--exclude historical --exclude mips --exclude stages \
|
|
||||||
--exclude packagecd --exclude snapshots --exclude livecd "
|
|
||||||
for ARCH in $ARCH_EXCLUDE; do
|
|
||||||
EXCLUDE=$EXCLUDE"--exclude $ARCH "
|
|
||||||
done
|
|
||||||
PATHLOCAL=$PATHFTP"$DIST/"
|
|
||||||
ENTMAIL2="$DIST ($PATHLOCAL)\n======\n"
|
|
||||||
TAIL=21
|
|
||||||
;;
|
|
||||||
|
|
||||||
Knoppix)
|
|
||||||
# Adresse du miroir
|
|
||||||
MIRROR="rsync://ftp.belnet.be/packages/knoppix/"
|
|
||||||
# Architectures à exclure (à choisir parmi :
|
|
||||||
# alpha, amd64, hppa, ia64, ppc, ppc64, sparc, x86)
|
|
||||||
ARCH_EXCLUDE=""
|
|
||||||
# Exclusions supplémentaires
|
|
||||||
EXCLUDE="--exclude contrib --exclude docs --exclude dvd \
|
|
||||||
--exclude knoppix-cover --exclude knoppix-customize \
|
|
||||||
--exclude knoppix-dvd --exclude packages-dvd.txt \
|
|
||||||
--exclude knoppix-vortrag-als2000 --exclude md5-old --exclude qemu-0.8.1 \
|
|
||||||
--exclude qemu-0.8.1-windows-README.txt --exclude *DE* "
|
|
||||||
for ARCH in $ARCH_EXCLUDE; do
|
|
||||||
EXCLUDE=$EXCLUDE"--exclude $ARCH "
|
|
||||||
done
|
|
||||||
PATHLOCAL=$PATHFTP"$DIST/"
|
|
||||||
ENTMAIL2="$DIST ($PATHLOCAL)\n=======\n"
|
|
||||||
TAIL=21
|
|
||||||
;;
|
|
||||||
|
|
||||||
Ubuntu)
|
|
||||||
# Adresse du miroir
|
|
||||||
MIRROR="rsync://ftp.oleane.net/ubuntu-cd/"
|
|
||||||
# Architectures à exclure (à choisir parmi :
|
|
||||||
# amd64 i386 powerpc sparc)
|
|
||||||
ARCH_EXCLUDE="amd64 powerpc sparc"
|
|
||||||
# Fichiers/repertoires à exclude pour ces architectures
|
|
||||||
# de la forme "--exclude foo1$ARCH/ --exclude foo2$ARCH/ ... "
|
|
||||||
#ARCH_FR_EXCL="--exclude ${ARCH} "
|
|
||||||
# Exclusions supplémentaires
|
|
||||||
EXCLUDE="--exclude cdicons --exclude edubuntu --exclude favicon.ico \
|
|
||||||
--exclude FOOTER.html --exclude HEADER.html --exclude jigit \
|
|
||||||
--exclude releases --exclude ubuntu-server --exclude .trace \
|
|
||||||
--exclude .htaccess --exclude .manifest "
|
|
||||||
# A virer une fois les tests finis
|
|
||||||
EXCLUDE=$EXCLUDE"--exclude kubuntu* --exclude xubuntu* --exclude ubuntu* "
|
|
||||||
for ARCH in $ARCH_EXCLUDE; do
|
|
||||||
EXCLUDE=$EXCLUDE"--exclude *-$ARCH.* "
|
|
||||||
done
|
|
||||||
PATHLOCAL=$PATHFTP"$DIST/"
|
|
||||||
ENTMAIL2="$DIST ($PATHLOCAL)\n======\n"
|
|
||||||
TAIL=8
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
umask 002
|
|
||||||
rsync $RSYNCOPT $EXCLUDE $MIRROR $PATHLOCAL > $LOGRSYNC
|
|
||||||
ERRC=$?
|
|
||||||
cat $LOGRSYNC
|
|
||||||
# En cas d'erreur, on notifie avec le code de sortie.
|
|
||||||
if [ $ERRC != 0 ]; then
|
|
||||||
echo "Erreur $ERRC"
|
|
||||||
echo -e $ENTMAIL2 >> $LOGMAIL
|
|
||||||
echo -e "Erreur, le processus rsync a retourné le code $ERRC.\n\n" >> $LOGMAIL
|
|
||||||
else
|
|
||||||
# Si une mise à jour a été effectuée, on notifie.
|
|
||||||
tail -n +$TAIL $LOGRSYNC > $LOGTEMP
|
|
||||||
# Sortie de test
|
|
||||||
cat $LOGTEMP
|
|
||||||
STATUS=$(cat $LOGTEMP | wc -l)
|
|
||||||
if (($STATUS > 2)); then
|
|
||||||
echo -e $ENTMAIL2 >> $LOGMAIL
|
|
||||||
cat $LOGTEMP >> $LOGMAIL
|
|
||||||
echo -e "\n" >> $LOGMAIL
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#echo $STATUS
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
# Fonction d'envoi du mail de notification
|
|
||||||
mail_ftp() {
|
|
||||||
local FROM="From:FTP Public (Sila)<roots@crans.org>"
|
|
||||||
local SUBJECT="Notification de synchronisation du FTP"
|
|
||||||
local RECIPIENT="<roots@crans.org>"
|
|
||||||
local XMAILER="X-Mailer:Bash sync-ftp (by August')"
|
|
||||||
echo $1 | mail -a "$FROM" -a "$XMAILER" -s "$SUBJECT" $RECIPIENT < $1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Envoi du mail de notification
|
|
||||||
LENGTH_MAIL=$(cat $LOGMAIL | wc -l)
|
|
||||||
if (($LENGTH_MAIL > 4)); then
|
|
||||||
echo -e $ENTMAIL3 >> $LOGMAIL
|
|
||||||
mail_ftp $LOGMAIL
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $LENGTH_MAIL
|
|
||||||
|
|
||||||
# Nettoyage des fichiers temporaires
|
|
||||||
rm -f $LOGRSYNC
|
|
||||||
rm -f $LOGTEMP
|
|
||||||
rm -f $LOGMAIL
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -25,7 +25,7 @@ host = gethostname()
|
||||||
debug = None
|
debug = None
|
||||||
mail_report = u'disconnect@crans.org'
|
mail_report = u'disconnect@crans.org'
|
||||||
mail_sender = u"Comptes inactifs <disconnect@crans.org>"
|
mail_sender = u"Comptes inactifs <disconnect@crans.org>"
|
||||||
template_path = '/usr/scripts/templates/comptes_inactifs.%d.txt'
|
template_path = '/usr/scripts/surveillance/comptes_inactifs/comptes_inactifs.%d.txt'
|
||||||
actions = ('log', 'dump', 'summary', 'spam')
|
actions = ('log', 'dump', 'summary', 'spam')
|
||||||
|
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
|
|
|
@ -1,117 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: iso8859-15 -*-
|
|
||||||
|
|
||||||
""" Script de lancement de mumudvb
|
|
||||||
|
|
||||||
Auteur : Frédéric Pauget
|
|
||||||
Licence : GPLv2
|
|
||||||
"""
|
|
||||||
import sys, getopt, os
|
|
||||||
from sat_base import NotRunning, CarteOqp
|
|
||||||
|
|
||||||
if os.getuid() == 0 :
|
|
||||||
os.system("su tv -c %s" % " ".join(sys.argv))
|
|
||||||
sys.exit(0)
|
|
||||||
elif os.getuid() != 101 :
|
|
||||||
print "Ce programme doit être lancé par l'utilisateur tv (uid=101)"
|
|
||||||
print "Astuce : sudo -u tv %s" % sys.argv[0]
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def usage(erreur=None) :
|
|
||||||
if erreur :
|
|
||||||
print erreur
|
|
||||||
print """Usage :
|
|
||||||
%(p)s start [<numero carte> [<transpondeur>]]:
|
|
||||||
démarrage le transpondeur donné sur la carte donnée,
|
|
||||||
si le transpondeur est omis démarre celui défini dans la conf
|
|
||||||
si seul démarre des flux définis dans la conf
|
|
||||||
%(p)s stop [numero carte] :
|
|
||||||
arrête tous les flux des cartes spécifiées,
|
|
||||||
si aucune carte est fournie arrète tous les flux
|
|
||||||
%(p)s restart [numero carte] :
|
|
||||||
démarre tous les flux des cartes spécifiées
|
|
||||||
si aucune carte est fournie redémarre tous les flux
|
|
||||||
|
|
||||||
Les options possibles sont :
|
|
||||||
-d ou --debug : affiche tous les messages
|
|
||||||
et ne daemonize pas mumudvb
|
|
||||||
-v ou --verbose : affiche les messages de debuggage
|
|
||||||
-q ou --quiet : affiche rien
|
|
||||||
--timeout_accord=<nb> : nb de secondes données pour l'accord""" \
|
|
||||||
% { 'p' : sys.argv[0].split('/')[-1] + ' [options]'}
|
|
||||||
if not erreur : sys.exit(0)
|
|
||||||
else : sys.exit(-1)
|
|
||||||
|
|
||||||
# Arguments
|
|
||||||
try :
|
|
||||||
options, args = getopt.getopt(sys.argv[1:], 'hdvq', [ 'help', 'debug' , 'quiet' , 'verbose', 'timeout_accord='] )
|
|
||||||
except getopt.error, msg :
|
|
||||||
sys.stderr.write('%s\n' % msg)
|
|
||||||
sys.exit(255)
|
|
||||||
|
|
||||||
verbose = 1
|
|
||||||
timeout_accord = 20
|
|
||||||
for opt, val in options :
|
|
||||||
if opt in [ '-v' , '--verbose' ] :
|
|
||||||
verbose = 2
|
|
||||||
elif opt in [ '-d' , '--debug' ] :
|
|
||||||
verbose = 3
|
|
||||||
elif opt == [ '-q' , '--quiet' ] :
|
|
||||||
verbose = 0
|
|
||||||
elif opt == '--timeout_accord' :
|
|
||||||
try:
|
|
||||||
timeout_accord = int(val)
|
|
||||||
except:
|
|
||||||
usage("Valeur de timeout_accord (%s) incorrecte" % val)
|
|
||||||
elif opt in [ '-h', '--help' ] :
|
|
||||||
usage()
|
|
||||||
|
|
||||||
if not args :
|
|
||||||
usage('Argument requis')
|
|
||||||
|
|
||||||
elif args[0] not in [ 'start', 'stop' , 'restart' ] :
|
|
||||||
usage("Commande %s incorrecte" % args[0])
|
|
||||||
|
|
||||||
|
|
||||||
# Carte fournie ?
|
|
||||||
try :
|
|
||||||
cartes = [ int(args[1]) ]
|
|
||||||
except ValueError :
|
|
||||||
usage("Argument %s incorrect (doit être le numéro de carte)." % args[1])
|
|
||||||
except :
|
|
||||||
# Toutes les cartes
|
|
||||||
cartes = range(6)
|
|
||||||
if verbose > 2 :
|
|
||||||
print "Mode debug non permis avec le lancement automatique"
|
|
||||||
verbose = 3
|
|
||||||
|
|
||||||
if args[0] in ( 'start', 'restart' ) :
|
|
||||||
if cartes == range(6) :
|
|
||||||
from sat_conf import conf
|
|
||||||
cartes = conf
|
|
||||||
else :
|
|
||||||
transpondeur = args[2]
|
|
||||||
from sat_base import *
|
|
||||||
try :
|
|
||||||
carte = eval(transpondeur)
|
|
||||||
cartes = [ carte(cartes[0]) ]
|
|
||||||
except NameError:
|
|
||||||
usage('Transpondeur %s inconnu.' % transpondeur)
|
|
||||||
|
|
||||||
|
|
||||||
elif args[0] == 'stop' :
|
|
||||||
from sat_base import carte
|
|
||||||
cartes = map(carte,cartes)
|
|
||||||
|
|
||||||
# On effectue l'opération demandée
|
|
||||||
for carte in cartes :
|
|
||||||
carte.verbose = verbose
|
|
||||||
carte.timeout_accord = timeout_accord
|
|
||||||
try :
|
|
||||||
eval('carte.%s()' % args[0])
|
|
||||||
except CarteOqp :
|
|
||||||
print "Carte %i occupée, abandon" % carte.card
|
|
||||||
except NotRunning :
|
|
||||||
# Pas réussi à lancer, TODO
|
|
||||||
pass
|
|
||||||
|
|
140
tv/old/sap.py
140
tv/old/sap.py
|
@ -1,140 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: iso-8859-15 -*-
|
|
||||||
|
|
||||||
""" Génération de la configuration sap à partir des données de mumudvb
|
|
||||||
Lancement du serveur sap.
|
|
||||||
|
|
||||||
Option -d pour que le programme ne se lance pas en daemon. """
|
|
||||||
|
|
||||||
import os, sys, signal
|
|
||||||
from socket import getfqdn
|
|
||||||
from time import sleep
|
|
||||||
from commands import getoutput
|
|
||||||
|
|
||||||
sys.path.append('/usr/scripts/python-lib')
|
|
||||||
import lock
|
|
||||||
from daemon import daemonize
|
|
||||||
|
|
||||||
|
|
||||||
################CONFIG
|
|
||||||
|
|
||||||
SAP_CONF = '/etc/sap.cfg'
|
|
||||||
LOCK='/var/run/mumudvb/sap'
|
|
||||||
CHAINES_DIFFUSES = '/var/run/mumudvb/chaines_diffusees_carte%d'
|
|
||||||
base_conf = """##################################
|
|
||||||
# Fichier généré automatiquement #
|
|
||||||
# NE PAS EDITER #
|
|
||||||
##################################
|
|
||||||
[global]
|
|
||||||
sap_ttl=4
|
|
||||||
sap_ipversion=4
|
|
||||||
sap_delay=10
|
|
||||||
ipv6_scope=8
|
|
||||||
"""
|
|
||||||
|
|
||||||
chaine_template="""
|
|
||||||
[program]
|
|
||||||
name=%s
|
|
||||||
user=crans
|
|
||||||
machine=%s
|
|
||||||
site=http://www.crans.org
|
|
||||||
address=%s
|
|
||||||
port=%s
|
|
||||||
program_ttl=4
|
|
||||||
program_ipversion=4
|
|
||||||
playlist_group=%s
|
|
||||||
""" % ( '%(nom)s', getfqdn(), '%(ip)s', '%(port)s', '%(langue)s' )
|
|
||||||
|
|
||||||
################FIN CONFIG
|
|
||||||
|
|
||||||
# Variables globales, ne pas toucher
|
|
||||||
sap_pid = 0
|
|
||||||
sum = 0
|
|
||||||
class no_data(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def gen_sap() :
|
|
||||||
""" Génération du ficher de conf du sap """
|
|
||||||
data = []
|
|
||||||
for i in range(0,6) :
|
|
||||||
try :
|
|
||||||
data.append(open(CHAINES_DIFFUSES % i).readlines())
|
|
||||||
except IOError :
|
|
||||||
continue
|
|
||||||
|
|
||||||
file = open(SAP_CONF,'w')
|
|
||||||
file.write(base_conf)
|
|
||||||
ok=0
|
|
||||||
for fichier in data :
|
|
||||||
for line in fichier :
|
|
||||||
ip, port, nom_chaine = line.strip().split(':')
|
|
||||||
file.write(chaine_template % {
|
|
||||||
'nom' : nom_chaine,
|
|
||||||
'langue': nom_chaine.split()[0],
|
|
||||||
'ip' : ip,
|
|
||||||
'port' : port} )
|
|
||||||
ok=1
|
|
||||||
file.close()
|
|
||||||
if not ok : raise no_data
|
|
||||||
|
|
||||||
def is_alive(child_pid) :
|
|
||||||
""" Vérifie si le processus fils tourne """
|
|
||||||
try :
|
|
||||||
if os.waitpid(child_pid,1) != (0,0) :
|
|
||||||
raise OSError
|
|
||||||
return True
|
|
||||||
except OSError :
|
|
||||||
return False
|
|
||||||
|
|
||||||
def term(a=None,b=None) :
|
|
||||||
""" Tue le serveur sap puis quitte """
|
|
||||||
kill()
|
|
||||||
lock.remove_lock(LOCK)
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
def kill() :
|
|
||||||
""" Tue le serveur sap """
|
|
||||||
if not is_alive(sap_pid) :
|
|
||||||
return
|
|
||||||
print "Kill sap"
|
|
||||||
os.kill(sap_pid,15)
|
|
||||||
sleep(1)
|
|
||||||
if is_alive(sap_pid) :
|
|
||||||
# Salloperie
|
|
||||||
print "WARNING : sap résitant"
|
|
||||||
os.kill(sap_pid,9)
|
|
||||||
sleep(1)
|
|
||||||
|
|
||||||
if __name__ == '__main__' :
|
|
||||||
sys.exit(0)
|
|
||||||
# Arguments
|
|
||||||
if '-d' not in sys.argv :
|
|
||||||
daemonize()
|
|
||||||
|
|
||||||
# Lock
|
|
||||||
lock.make_lock(LOCK,"Serveur SAP")
|
|
||||||
|
|
||||||
# Signal handler
|
|
||||||
signal.signal(signal.SIGTERM,term)
|
|
||||||
signal.signal(signal.SIGINT,term)
|
|
||||||
|
|
||||||
while 1 :
|
|
||||||
try :
|
|
||||||
gen_sap()
|
|
||||||
except no_data :
|
|
||||||
# Rien n'est diffusé
|
|
||||||
kill()
|
|
||||||
else :
|
|
||||||
# Changent de config ?
|
|
||||||
new_sum = getoutput('md5sum %s' % SAP_CONF).split()[0]
|
|
||||||
if new_sum != sum :
|
|
||||||
print "Reconfiguration"
|
|
||||||
sum = new_sum
|
|
||||||
if sap_pid>1 and is_alive(sap_pid) :
|
|
||||||
kill()
|
|
||||||
if not is_alive(sap_pid) :
|
|
||||||
# Ne tourne pas, on relance
|
|
||||||
sap_pid = os.spawnl(os.P_NOWAIT,'/usr/local/bin/sapserver','sap','-f',SAP_CONF)
|
|
||||||
print "Lancement serveur, pid=%s" % sap_pid
|
|
||||||
|
|
||||||
sleep(60)
|
|
|
@ -1,463 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: iso8859-15 -*-
|
|
||||||
|
|
||||||
"""
|
|
||||||
Configuration de base des différents transpondeurs disponibles
|
|
||||||
Ce fichier contient la liste des chaines pour chaque transpondeur.
|
|
||||||
|
|
||||||
Pour chaque chaine, on doit indiquer le nom de la chaine et au minimum :
|
|
||||||
- Le pid audio
|
|
||||||
- Le pid video
|
|
||||||
- Le pid PMT, ce pid contient la liste des differents flux associes a une chaine
|
|
||||||
VLC a besoin de ce PID pour lire le flux
|
|
||||||
|
|
||||||
Les pids facultatifs sont les suivants :
|
|
||||||
- Le PID PCR qui indique la base de temps (Program Clock Reference)
|
|
||||||
et permet de mieux reconstituer les flux un peu defecteux, et sert
|
|
||||||
aussi pour synchroniser les informations teletexte.
|
|
||||||
Il est conseille de le mettre, et il est souvent present avec le
|
|
||||||
flux video (cas de la TNT)
|
|
||||||
- Les PIDs de teletexte
|
|
||||||
"""
|
|
||||||
|
|
||||||
#Auteur : Frédéric Pauget
|
|
||||||
#Maintenance et adaptations : DUBOST Brice
|
|
||||||
#Licence : GPLv2
|
|
||||||
|
|
||||||
from commands import getoutput
|
|
||||||
from time import sleep
|
|
||||||
import os, socket
|
|
||||||
|
|
||||||
IP = socket.gethostbyaddr(socket.gethostname())[-1][0]
|
|
||||||
|
|
||||||
class CarteOqp(Exception) :
|
|
||||||
""" La carte est déja utilisée """
|
|
||||||
|
|
||||||
class NotRunning(Exception) :
|
|
||||||
""" La carte ne diffuse rien """
|
|
||||||
|
|
||||||
class carte :
|
|
||||||
""" Classe parent de toute classe de transpondeur """
|
|
||||||
# Niveux de verbosite :
|
|
||||||
# 0 : ne dit rien
|
|
||||||
# 1 : messages à caractères informatifs
|
|
||||||
# 2 : messages de debug
|
|
||||||
# 3 : ne permet pas à mumudvb de daemonizer
|
|
||||||
verbose = 3
|
|
||||||
|
|
||||||
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
|
||||||
|
|
||||||
timeout_accord=20 #en secondes
|
|
||||||
timeout_no_diff=60 #en secondes
|
|
||||||
|
|
||||||
entete_conf = """### Fichier généré, NE PAS EDITER
|
|
||||||
autoconfiguration=1
|
|
||||||
sap=1
|
|
||||||
sap_organisation=crans
|
|
||||||
common_port=1234
|
|
||||||
freq=%(freq)i
|
|
||||||
pol=%(pol)s
|
|
||||||
srate=%(srate)i
|
|
||||||
card=%(card)i
|
|
||||||
timeout_accord=%(timeout_accord)i
|
|
||||||
timeout_no_diff=%(timeout_no_diff)i
|
|
||||||
#-----
|
|
||||||
"""
|
|
||||||
|
|
||||||
entete_conf_TNT = """### Fichier généré, NE PAS EDITER
|
|
||||||
autoconfiguration=1
|
|
||||||
sap=1
|
|
||||||
sap_organisation=crans
|
|
||||||
common_port=1234
|
|
||||||
freq=%(freq)i
|
|
||||||
qam=%(qam)s
|
|
||||||
trans_mode=%(trans_mode)s
|
|
||||||
bandwidth=%(bandwidth)s
|
|
||||||
guardinterval=%(guardinterval)s
|
|
||||||
coderate=%(coderate)s
|
|
||||||
card=%(card)i
|
|
||||||
timeout_accord=%(timeout_accord)i
|
|
||||||
timeout_no_diff=%(timeout_no_diff)i
|
|
||||||
"""
|
|
||||||
|
|
||||||
chaine_template = """ip=%(ip)s
|
|
||||||
sap_group=%(sap_group)s
|
|
||||||
name=%(name)s
|
|
||||||
pids=%(pids)s
|
|
||||||
#-----
|
|
||||||
"""
|
|
||||||
|
|
||||||
autoconf2_template = """common_port=1234
|
|
||||||
autoconfiguration=2
|
|
||||||
autoconf_ip_header=%(ip)s
|
|
||||||
sap_default_group=various
|
|
||||||
#-----
|
|
||||||
"""
|
|
||||||
|
|
||||||
pid_file = "/var/run/mumudvb/mumudvb_carte%i.pid" # % num carte
|
|
||||||
mumudvb = "/usr/local/bin/mumudvb_sap "
|
|
||||||
|
|
||||||
def __cmp__(a,b) :
|
|
||||||
for attr in ( 'card', 'freq', 'chaines' ) :
|
|
||||||
if getattr(a,attr) != getattr(b,attr) :
|
|
||||||
return -2
|
|
||||||
return 0
|
|
||||||
|
|
||||||
def __init__(self,card) :
|
|
||||||
""" Initalisation card est le numéro (entier) de la carte
|
|
||||||
correspondante """
|
|
||||||
try :
|
|
||||||
self.freq = int(str(self.__class__).split('_')[-1])
|
|
||||||
except :
|
|
||||||
# On ne pourra pas faire grand chose à part killer le flux de la carte
|
|
||||||
self.freq = ''
|
|
||||||
pass
|
|
||||||
self.card = card
|
|
||||||
|
|
||||||
def gen_conf(self) :
|
|
||||||
""" Génère le fichier de conf """
|
|
||||||
if not self.freq :
|
|
||||||
if self.verbose > 1 : print "Instance ne permettant pas la génération de la conf"
|
|
||||||
return
|
|
||||||
|
|
||||||
fd = open(self.CONF_FILE % self.card,'w')
|
|
||||||
# Entète du fichier
|
|
||||||
try:
|
|
||||||
fd.write( self.entete_conf_TNT %
|
|
||||||
{ 'qam' : self.qam, 'trans_mode' : self.trans_mode ,
|
|
||||||
'bandwidth' : self.bandwidth, 'guardinterval' : self.guardinterval ,
|
|
||||||
'coderate' : self.coderate,
|
|
||||||
'freq' : self.freq , 'card' : self.card ,
|
|
||||||
'timeout_accord' : self.timeout_accord ,
|
|
||||||
'timeout_no_diff' : self.timeout_no_diff } )
|
|
||||||
except:
|
|
||||||
fd.write( self.entete_conf %
|
|
||||||
{ 'pol' : self.pol, 'srate' : self.srate ,
|
|
||||||
'freq' : self.freq , 'card' : self.card ,
|
|
||||||
'timeout_accord' : self.timeout_accord ,
|
|
||||||
'timeout_no_diff' : self.timeout_no_diff } )
|
|
||||||
|
|
||||||
# Chaines
|
|
||||||
n = 0
|
|
||||||
for pids, (sap_group, name) in self.chaines.items() :
|
|
||||||
ip = '239.%s.20%i.2%02i' % ( IP.split('.')[-1], self.card, n)
|
|
||||||
n += 1
|
|
||||||
fd.write(self.chaine_template % vars())
|
|
||||||
|
|
||||||
#Si pas de chaines, on passe en autoconfiguration=2
|
|
||||||
if not n :
|
|
||||||
ip = '239.%s' % ( IP.split('.')[-1])
|
|
||||||
fd.write(self.autoconf2_template % { "ip" : ip})
|
|
||||||
|
|
||||||
fd.close()
|
|
||||||
|
|
||||||
def get_pid(self) :
|
|
||||||
""" Retourne le pid associé à la carte """
|
|
||||||
try:
|
|
||||||
pid = int(open(self.pid_file % self.card).readline().strip())
|
|
||||||
if self.verbose > 1 :
|
|
||||||
print 'pid : %i' % pid ,
|
|
||||||
return pid
|
|
||||||
except :
|
|
||||||
raise NotRunning
|
|
||||||
|
|
||||||
def is_running(self) :
|
|
||||||
""" Vérifie si le process correspondant à la carte toune """
|
|
||||||
if self.verbose > 1 :
|
|
||||||
redir = ''
|
|
||||||
else :
|
|
||||||
redir = '>/dev/null 2>&1'
|
|
||||||
try :
|
|
||||||
if not os.system('ps %i %s' % (self.get_pid() , redir) ) :
|
|
||||||
# Il tourne
|
|
||||||
return True
|
|
||||||
except NotRunning :
|
|
||||||
pass
|
|
||||||
return False
|
|
||||||
|
|
||||||
def start(self) :
|
|
||||||
""" Lance la diffusion """
|
|
||||||
if not self.freq :
|
|
||||||
if self.verbose > 1 : print "Instance ne permettant pas le lancement d'un flux"
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.verbose >0 :
|
|
||||||
print "Lancement de %s sur la carte %i" % (str(self.__class__).split('.')[-1], self.card)
|
|
||||||
|
|
||||||
if self.is_running() :
|
|
||||||
raise CarteOqp
|
|
||||||
|
|
||||||
if self.verbose >0 : print "\tGénération de la conf...",
|
|
||||||
self.gen_conf()
|
|
||||||
if self.verbose >0 : print "OK"
|
|
||||||
|
|
||||||
cmd = '%s -c %s' % ( self.mumudvb, self.CONF_FILE % self.card )
|
|
||||||
if self.verbose > 2 : cmd += ' -v -v -d -s'
|
|
||||||
if self.verbose > 1 :
|
|
||||||
print "\tCommande : %s" % cmd
|
|
||||||
for i in range(2*self.timeout_accord) :
|
|
||||||
if not i%5 and i <= self.timeout_accord :
|
|
||||||
if self.verbose > 0 and i : print "ATTENTE/ERREUR"
|
|
||||||
# On fait une tentative de lancement toutes les 5s (en cas de pb de diseq)
|
|
||||||
if self.verbose > 0 : print "\tTentative %i" %(i/5+1) ,
|
|
||||||
os.system(cmd)
|
|
||||||
sleep(1)
|
|
||||||
if self.is_running() :
|
|
||||||
if self.verbose > 0 : print 'OK'
|
|
||||||
break
|
|
||||||
sleep(1)
|
|
||||||
if not self.is_running() :
|
|
||||||
if self.verbose > 0 : print 'ABANDON'
|
|
||||||
raise NotRunning
|
|
||||||
|
|
||||||
def stop(self) :
|
|
||||||
""" Arrète la diffusion de la carte """
|
|
||||||
if self.verbose >0 :
|
|
||||||
print "Arret diffusion carte %i..." % self.card ,
|
|
||||||
|
|
||||||
try :
|
|
||||||
# Ca tourne au moins ?
|
|
||||||
if not self.is_running() :
|
|
||||||
if self.verbose >0 : print "carte déja arrétée"
|
|
||||||
return
|
|
||||||
|
|
||||||
os.kill(self.get_pid(),15)
|
|
||||||
sleep(1)
|
|
||||||
if not self.is_running() :
|
|
||||||
if self.verbose >0 : print "OK"
|
|
||||||
return
|
|
||||||
|
|
||||||
# Crève !!
|
|
||||||
if not self.is_running() :
|
|
||||||
if self.verbose >0 : print "SIGKILL"
|
|
||||||
return
|
|
||||||
|
|
||||||
os.kill(self.get_pid(),9)
|
|
||||||
# Salloperie
|
|
||||||
raise CarteOqp
|
|
||||||
except NotRunning :
|
|
||||||
# Parfait, c'était le but
|
|
||||||
pass
|
|
||||||
|
|
||||||
def restart(self) :
|
|
||||||
""" Redémarre le flux """
|
|
||||||
self.stop()
|
|
||||||
self.start()
|
|
||||||
|
|
||||||
#class Hotbird_10796(carte) :
|
|
||||||
# pol='v'
|
|
||||||
# srate=27500
|
|
||||||
# chaines = {
|
|
||||||
# '3336 3306' : 'radios' : 'rad fra Radio FG'),
|
|
||||||
# '3534 1001' : 'radios' : 'rad fra France Inter'),
|
|
||||||
# '3535 1002' : 'radios' : 'rad fra France Info' }
|
|
||||||
|
|
||||||
#Format : "'pids' : ( 'groupe sap' : 'nom' ),"
|
|
||||||
|
|
||||||
class Hotbird_10853(carte) :
|
|
||||||
pol='h'
|
|
||||||
srate=27500
|
|
||||||
chaines = {}
|
|
||||||
|
|
||||||
class Hotbird_11137(carte) :
|
|
||||||
pol='h'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'717' : ('fra' , 'fra TV5MONDE FBS'),
|
|
||||||
'719' : ('fra' , 'fra TV5MONDE Europe'),
|
|
||||||
'262' : ('ara' , 'ara ANN'),
|
|
||||||
'263' : ('ara' , 'ara Kurdistan TV'),
|
|
||||||
'264' : ('ita' , 'ita Videolina')}
|
|
||||||
|
|
||||||
class Hotbird_11200(carte) : #A mettre a jour
|
|
||||||
pol='V'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'366 367 2560' : ('ita' , 'ita Elite shopping TV'),
|
|
||||||
'386 387 512' : ('x-ero' , 'x-ero All Sex'),
|
|
||||||
'397 398 399' : ('ita' , 'ita StarSat'),
|
|
||||||
'394 395 4864' : ('ita' , 'ita Play TV'),
|
|
||||||
'400 404 402' : ('ita' , 'ita People TV'),
|
|
||||||
'405 406 407' : ('ita' , 'ita Roma Sat')}
|
|
||||||
|
|
||||||
class Hotbird_11240(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'244' : ('fra' , 'fra France 24'),
|
|
||||||
'247' : ('eng' , 'eng France 24'),
|
|
||||||
'401' : ('fra' , 'fra RTBF sat')}
|
|
||||||
|
|
||||||
class Hotbird_11604(carte) :
|
|
||||||
pol='h'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'500' : ('ita' , 'ita TLA'),
|
|
||||||
'600' : ('ger' , 'ger Das Erste'),
|
|
||||||
'700' : ('ger' , 'ger DW TV'),
|
|
||||||
'800' : ('divers' , 'divers DW tv arabic (ara eng ger)'),
|
|
||||||
'900' : ('ger' , 'ger RTL2 Schweiz'),
|
|
||||||
'3500' : ('eng' , 'eng Cool TV'),
|
|
||||||
'2600' : ('ger' , 'ger Erde Mensch'),
|
|
||||||
'1600' : ('x-ero' , 'x-ero hot arab tv'),
|
|
||||||
'3200' : ('x-ero' , 'x-ero xxx Action TV')}
|
|
||||||
|
|
||||||
class Hotbird_11623(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {}
|
|
||||||
|
|
||||||
class Hotbird_11642(carte) :
|
|
||||||
pol='h'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'1360 1320 5003' : ('eng' , 'eng Bloomberg Europe'),
|
|
||||||
'1460 1420 5004' : ('ger' , 'ger Bloomberg TV Deutschland'),
|
|
||||||
'1560 1520 5005' : ('eng' , 'eng Bloomberg U.K.'),
|
|
||||||
'2101 2111 256 128 2121' : ('gr' , 'gr ERT Sat')}
|
|
||||||
|
|
||||||
class Hotbird_11727(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'2711 2712 257 2710' : ('fra' , 'fra La Locale'),
|
|
||||||
'2791 2792 269' : ('ita' , 'ita Sicilia International (SET)'),
|
|
||||||
'2751 2752 266' : ('ita' , 'ita Sardegna Uno Sat'),
|
|
||||||
'6507 6662' : ('radios' , 'rad eng BBC English (Europe)'),
|
|
||||||
'6510 6692' : ('radios' , 'rad eng BBC English News'),
|
|
||||||
'7302 6571' : ('radios' , 'rad eng BBC Feed 1'),
|
|
||||||
'7312 6572' : ('radios' , 'rad eng BBC Feed 2'),
|
|
||||||
'7322 6573' : ('radios' , 'rad eng BBC Feed 3'),
|
|
||||||
'7332 6574' : ('radios' , 'rad eng BBC Feed 4'),
|
|
||||||
'7342 6575' : ('radios' , 'rad eng BBC Feed 5'),
|
|
||||||
'7352 6576' : ('radios' , 'rad eng BBC Feed 6')}
|
|
||||||
|
|
||||||
# Pour remplacer 10796
|
|
||||||
class Hotbird_11766(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'1104' : ('ita' , 'ita Rai Uno'),
|
|
||||||
'1105' : ('ita' , 'ita Rai Duo'),
|
|
||||||
'1106' : ('ita' , 'ita Rai Tre'),
|
|
||||||
'260' : ('ita' , 'ita Rai Med'),
|
|
||||||
'1107' : ('ita' , 'ita eng Senato italiano'),
|
|
||||||
'1107' : ('eng' , 'eng ita Senato italiano'),
|
|
||||||
'261' : ('ita' , 'ita Rai Edu2')}
|
|
||||||
|
|
||||||
class Hotbird_11727(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {}
|
|
||||||
|
|
||||||
class Hotbird_11054(carte) :
|
|
||||||
pol='h'
|
|
||||||
srate=27500
|
|
||||||
chaines = {}
|
|
||||||
|
|
||||||
class Hotbird_12111(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'1028' : ('ara' , 'ara Al Jazeera Documentary'),
|
|
||||||
'1029' : ('ara' , 'ara Al Jazeera Mubasher'),
|
|
||||||
'1030' : ('ita' , 'ita ACM - Architecture Construction Materials'),
|
|
||||||
'1031' : ('ara' , 'ara Al Jazeera Satellite Channel'),
|
|
||||||
'1032' : ('ita' , 'ita Silicia Channel'),
|
|
||||||
'1034' : ('ita' , 'ita High life TV'),
|
|
||||||
'1040' : ('ita' , 'ita Radio Radio TV'),
|
|
||||||
'1042' : ('ita' , 'ita MediterraneoSat 1')}
|
|
||||||
|
|
||||||
class Hotbird_12476(carte) :
|
|
||||||
pol='h'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
#2M don't support autoconfiguration
|
|
||||||
'600 601 602' : ('ara' , 'ara fra 2M'),
|
|
||||||
'600 603' : ('ara' , 'ara radio 2M'),
|
|
||||||
'550' : ('x-ero' , 'x-ero X Stream')}
|
|
||||||
|
|
||||||
class Hotbird_12558(carte) : #outdated
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'6660 6661 6659' : ('ita' , 'ita Administra.it'),
|
|
||||||
'6916 6917 6915 6930' : ('ita' , 'ita 24 Ore')}
|
|
||||||
|
|
||||||
class Hotbird_12597(carte) :
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'1024' : ('rus' , 'rus sport planeta'),
|
|
||||||
'1027' : ('eng' , 'eng BBC World'),
|
|
||||||
'1031' : ('rus' , 'rus ORT International'),
|
|
||||||
'1032' : ('eng' , 'eng CNN'),
|
|
||||||
'1034' : ('fra' , 'fra autres Euronews'),
|
|
||||||
'1034 2221 2232 768' : ('eng' , 'eng Euronews')}
|
|
||||||
|
|
||||||
class Hotbird_12673(carte) : #outdated
|
|
||||||
pol='v'
|
|
||||||
srate=27500
|
|
||||||
chaines = {
|
|
||||||
'308 309 306 307' : ('ara' , 'ara Al Maghribiyah'),
|
|
||||||
'35 36 33 34 38' : ('ara' , 'ara TVM inter l'),
|
|
||||||
'46 47 44 45' : ('ara' , 'ara Arabiaa')}
|
|
||||||
|
|
||||||
class TNT_base(carte) :
|
|
||||||
qam="auto"
|
|
||||||
trans_mode="auto"
|
|
||||||
guardinterval="auto"
|
|
||||||
coderate="auto"
|
|
||||||
bandwidth="8MHz"
|
|
||||||
|
|
||||||
class TNT_R1_586000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'110' : ('fra' , 'fra TNT02 France 2'),
|
|
||||||
'210' : ('fra' , 'fra TNT03 France 3'),
|
|
||||||
'310' : ('fra' , 'fra TNT05 France 5'),
|
|
||||||
'510' : ('fra' , 'fra TNT07 Arte'),
|
|
||||||
'510 520 531 542' : ('ger' , 'ger Arte'),
|
|
||||||
'610' : ('fra' , 'fra TNT13 LCP Public Senat'),
|
|
||||||
'710' : ('fra' , 'fra TNT20 France O')}
|
|
||||||
|
|
||||||
class TNT_R2_474000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'1280' : ('fra' , 'fra TNT08 Direct 8'),
|
|
||||||
'1282' : ('fra' , 'fra TNT15 BFM TV'),
|
|
||||||
'1283' : ('fra' , 'fra TNT16 i tele'),
|
|
||||||
'1284' : ('fra' , 'fra TNT17 Virgin17'),
|
|
||||||
'1286' : ('fra' , 'fra TNT14 France 4'),
|
|
||||||
'1285' : ('fra' , 'fra TNT18 Gulli')}
|
|
||||||
|
|
||||||
#les pids ont tendance a changer souvent pour canal, on en met le plus possible
|
|
||||||
class TNT_R3_522000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'1280 80 81 83 32 33 170 120 121 123 62 52' : ('fra' , 'fra TNT04 Canal')}
|
|
||||||
|
|
||||||
class TNT_R4_498000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'110' : ('fra' , 'fra TNT06 M6'),
|
|
||||||
'210' : ('fra' , 'fra TNT09 W9'),
|
|
||||||
'310' : ('fra' , 'fra TNT11 NT1'),
|
|
||||||
'710' : ('fra' , 'fra TNT57 Arte HD')}
|
|
||||||
|
|
||||||
class TNT_R5_538000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'110' : ('fra' , 'fra TNT51 TF1 HD'),
|
|
||||||
'210' : ('fra' , 'fra TNT52 France 2 HD'),
|
|
||||||
'310' : ('fra' , 'fra TNT56 M6 HD')}
|
|
||||||
|
|
||||||
class TNT_R6_562000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'100' : ('fra' , 'fra TNT01 TF1'),
|
|
||||||
'600' : ('fra' , 'fra TNT10 TMC'),
|
|
||||||
'200' : ('fra' , 'fra TNT12 NRJ12')}
|
|
||||||
|
|
||||||
class TNT_R7_490000(TNT_base) :
|
|
||||||
chaines = {
|
|
||||||
'4321' : ('fra' , 'fra TNT21 Canal 21 : Cinaps TV, BDM TV, Bocal TV, Demain TV'),
|
|
||||||
'4322' : ('fra' , 'fra TNT22 IDF1'),
|
|
||||||
'4323' : ('fra' , 'fra TNT23 NRJ Paris'),
|
|
||||||
'4324' : ('fra' , 'fra TNT24 Cap 24')}
|
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: iso-8859-15 -*-
|
|
||||||
|
|
||||||
""" Défini les transpondeurs à associer à chacune des cartes """
|
|
||||||
|
|
||||||
from sat_base import *
|
|
||||||
from socket import gethostname
|
|
||||||
|
|
||||||
host = gethostname()
|
|
||||||
|
|
||||||
transpondeurs = { 'canard' : [ Hotbird_12476(0) ,
|
|
||||||
Hotbird_11240(1) ,
|
|
||||||
Hotbird_12597(2) ,
|
|
||||||
TNT_R4_498000(4) ,
|
|
||||||
Hotbird_11604(3) ],
|
|
||||||
'lapin' : [ Hotbird_11727(0) ,
|
|
||||||
# Hotbird_11623(1) , #Cette carte capte tres mal
|
|
||||||
TNT_R1_586000(2) ,
|
|
||||||
TNT_R6_562000(3) ,
|
|
||||||
TNT_R2_474000(4) ],
|
|
||||||
'oie' : [ Hotbird_10853(0) ,
|
|
||||||
Hotbird_11766(1) ,
|
|
||||||
Hotbird_12111(2) ,
|
|
||||||
Hotbird_11137(3) ,
|
|
||||||
TNT_R7_490000(4) ,
|
|
||||||
# TNT_R5_538000(4) ,
|
|
||||||
TNT_R3_522000(5) ]
|
|
||||||
}
|
|
||||||
|
|
||||||
conf = transpondeurs.get(host,[])
|
|
||||||
|
|
||||||
if __name__ == '__main__' :
|
|
||||||
import sys
|
|
||||||
if len(sys.argv) == 2 :
|
|
||||||
conf = transpondeurs.get(sys.argv[1],[])
|
|
||||||
for t in conf :
|
|
||||||
print t, "sur la carte", t.card
|
|
||||||
for (sap_group, chaine) in t.chaines.values() :
|
|
||||||
print '\t%s\t: \t%s' % (sap_group,chaine)
|
|
Loading…
Add table
Add a link
Reference in a new issue