Versión 1.0.4, #414: Pequeñas correcciones en scripts ejecutados por Cron.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2981 a21b9725-9963-47de-94b9-378ad31fedc9remotes/github/debian-pkg
parent
0ad88ebde6
commit
89a8208985
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
# Comprobamos si los servicios de opengnsys están levantado y si no es así los iniciamos.
|
||||
# Variables.
|
||||
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
|
||||
|
|
|
@ -36,7 +36,7 @@ for IMG in *.{img,pgz}; do
|
|||
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}')"
|
||||
read -e TORRFILE TORRSIZE <<<"$(ctorrent -x $TORRENT 2>/dev/null | awk '$1~/<1>/ {print $2,$3}')"
|
||||
[ "$(basename $IMG)" = "$TORRFILE" -a "[$FILESIZE]" = "$TORRSIZE" ] && continue
|
||||
fi
|
||||
# Bloquear imagen, crear ficheros Torrent y Checksum y desbloquear imagen.
|
||||
|
@ -46,7 +46,7 @@ for IMG in *.{img,pgz}; do
|
|||
rm -f "$TORRENT" "$SUMFILE"
|
||||
DATASUM=`md5sum "$IMG" | cut -f1 -d" "`
|
||||
echo $DATASUM > "$SUMFILE"
|
||||
nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM
|
||||
nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM 2>/dev/null
|
||||
rm -f "$LOCKFILE"
|
||||
if [ -f "$TORRENT" ]; then
|
||||
echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE
|
||||
|
|
Loading…
Reference in New Issue