summaryrefslogtreecommitdiffstats
path: root/repoman
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2012-07-19 08:55:27 +0000
committerramon <ramongomez@us.es>2012-07-19 08:55:27 +0000
commit1ca723075a19544f041c5267c345baa3193d70f8 (patch)
tree17eda30c4d8eec314bef6acaac69765806ab0d26 /repoman
parent1c93532b21492afae588da93f6ff59dd11a6e6d7 (diff)
Versión 1.0.4, #531: Congelar versión en {{{tags/version-1.0.4}}}
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.4@3261 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman')
-rwxr-xr-xrepoman/bin/opengnsys.cron5
-rwxr-xr-xrepoman/bin/torrent-creator6
2 files changed, 6 insertions, 5 deletions
diff --git a/repoman/bin/opengnsys.cron b/repoman/bin/opengnsys.cron
index 55022ef1..76236f73 100755
--- a/repoman/bin/opengnsys.cron
+++ b/repoman/bin/opengnsys.cron
@@ -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"}
@@ -8,11 +9,11 @@ DEFAULTFILE=/etc/default/opengnsys
[ -f $DEFAULTFILE ] && source $DEFAULTFILE
# Si un servicio debe estar activo y no se está ejecutando, reiniciar OpenGnSys.
-if [ "$RUN_OGADMSERVER" == "yes" -a $(pgrep -c ogAdmServer) == 0 ]; then
+if [ "$RUN_OGADMSERVER" == "yes" -a $(pgrep ogAdmServer | wc -w) == 0 ]; then
date +"%d/%m/%Y %T ERROR: El servicio ogAdmServer estaba caido, se reinicia" >> $LOGDIR/ogAdmServer.log
/etc/init.d/opengnsys restart
fi
-if [ "$RUN_OGADMREPO" == "yes" -a $(pgrep -c ogAdmRepo) == 0 ]; then
+if [ "$RUN_OGADMREPO" == "yes" -a $(pgrep ogAdmRepo | wc -w) == 0 ]; then
date +"%d/%m/%Y %T ERROR: El servicio ogAdmRepo estaba caido, se reinicia" >> $LOGDIR/ogAdmRepo.log
/etc/init.d/opengnsys restart
fi
diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator
index 21d58581..61765ed5 100755
--- a/repoman/bin/torrent-creator
+++ b/repoman/bin/torrent-creator
@@ -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.
@@ -44,9 +44,9 @@ for IMG in *.{img,pgz}; do
touch "$LOCKFILE"
trap "rm -f $LOCKFILE" 1 2 3 6 9
rm -f "$TORRENT" "$SUMFILE"
- DATASUM=`md5sum "$IMG" | cut -f1 -d" "`
+ DATASUM=$(tail -c1M "$IMG" | md5sum -b | 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