diff options
author | ramon <ramongomez@us.es> | 2011-03-02 12:52:17 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-03-02 12:52:17 +0000 |
commit | edac2474ac980dfa8ed66845cd2719eb89c857b9 (patch) | |
tree | a0685ccf9b0e06a885cf91df6599886f99b6057e /repoman | |
parent | 813f617ae2c1fad83befb13bccf8a05213a81ee6 (diff) |
Rama version1.0: corregir erratas de caminos en el instalador y adaptar script {{{torrent-creator}}} de la rama Testing.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1524 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman')
-rwxr-xr-x | repoman/bin/torrent-creator | 21 | ||||
-rwxr-xr-x[-rw-r--r--] | repoman/bin/torrent-tracker | 0 |
2 files changed, 11 insertions, 10 deletions
diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator index 5d43c753..21d58581 100755 --- a/repoman/bin/torrent-creator +++ b/repoman/bin/torrent-creator @@ -3,6 +3,7 @@ #Version 0.3 Ejecución desde cron cada minuto, ## echo "* * * * * root /opt/opengnsys/bin/torrent-creator" > /etc/cron.d/torrentcreator +## ver moficifcacione en linea 41 - 46 # Comprobar si el proceso ya está en ejecución. PROG=$(basename $0) @@ -26,27 +27,27 @@ pushd $OGIMG >/dev/null trap 'echo "`date` : Proceso interrumpido" >> $LOGFILE; exit ' 1 2 3 6 9 15 for IMG in *.{img,pgz}; do # Saltar al siguiente si la imagen está bloqueada o si no existe el fichero. - if [ -f "$IMG.lock" -o ! -f "$IMG" ]; then + LOCKFILE="$IMG.lock" + if [ -f "$LOCKFILE" -o ! -f "$IMG" ]; then continue fi # Comprobar si ya existe el fichero Torrent para esa imagen. TORRENT="$IMG.torrent" - if [ -f "$TORRENT" ]; then + SUMFILE="$IMG.sum" + if [ -f "$TORRENT" ]; then FILESIZE="$(ls -l $IMG | awk '{print $5}')" read -e TORRFILE TORRSIZE <<<"$(ctorrent -x $TORRENT | awk '$1~/<1>/ {print $2,$3}')" [ "$(basename $IMG)" = "$TORRFILE" -a "[$FILESIZE]" = "$TORRSIZE" ] && continue fi - # Crear fichero Torrent. + # Bloquear imagen, crear ficheros Torrent y Checksum y desbloquear imagen. echo "`date` : Inicio creación de fichero $TORRENT" >> $LOGFILE - rm -f "$TORRENT" - ##### ADV v. 1.0 23/02/2011 - rm -f $IMG.sum + touch "$LOCKFILE" + trap "rm -f $LOCKFILE" 1 2 3 6 9 + rm -f "$TORRENT" "$SUMFILE" DATASUM=`md5sum "$IMG" | cut -f1 -d" "` - echo $DATASUM > $IMG.sum + echo $DATASUM > "$SUMFILE" nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM - #### ADV v. 1.0 23/02/2011 - - nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" + rm -f "$LOCKFILE" if [ -f "$TORRENT" ]; then echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE else diff --git a/repoman/bin/torrent-tracker b/repoman/bin/torrent-tracker index f355b81a..f355b81a 100644..100755 --- a/repoman/bin/torrent-tracker +++ b/repoman/bin/torrent-tracker |