summaryrefslogtreecommitdiffstats
path: root/repoman/bin/torrent-creator
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-11-29 13:48:34 +0100
committerRamón M. Gómez <ramongomez@us.es>2018-11-29 13:48:34 +0100
commit07518803dbe5159cd639eb99023986c54dc7baa8 (patch)
treeb2e276e353348bb5cb1153ce0b1374359f386d80 /repoman/bin/torrent-creator
parent4f9b004d10d557ef46b1cd4616aa39c39d2567be (diff)
#881: Add personalization variable for torrents creation priority to default processes file.
Diffstat (limited to 'repoman/bin/torrent-creator')
-rwxr-xr-xrepoman/bin/torrent-creator6
1 files changed, 5 insertions, 1 deletions
diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator
index 958683ed..cfca393e 100755
--- a/repoman/bin/torrent-creator
+++ b/repoman/bin/torrent-creator
@@ -15,6 +15,10 @@ PATH=$PATH:$OPENGNSYS/bin
OGIMG="$OPENGNSYS/images"
REPOCFG="$OPENGNSYS/etc/ogAdmRepo.cfg"
LOGFILE="$OPENGNSYS/log/$PROG.log"
+DEFAULTFILE=/etc/default/opengnsys
+source $DEFAULTFILE
+# No hacer nada si no está definido como repositorio.
+[ "$RUN_OGADMREPO" == "yes" ] || exit 0
# Error si no está bien configurado el repositorio de imágenes.
[ -d $OGIMG -a -f $REPOCFG ] || exit 1
source $REPOCFG
@@ -52,7 +56,7 @@ for IMG in *.{img,pgz,diff,dsk} */*.{img,pgz,diff,dsk} ; do
# Datasum completo para transferencias torrent
DATAFULLSUM=$(md5sum -b "$IMG"| cut -f1 -d" ")
echo $DATAFULLSUM > "$SUMFULLFILE"
- nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATAFULLSUM -l 4194304 2>/dev/null
+ nice -n ${BTSEEDER_PRIORITY:-0} ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATAFULLSUM -l 4194304 2>/dev/null
rm -f "$LOCKFILE"
if [ -f "$TORRENT" ]; then
echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE