summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/Sources/Services/opengnsys.default11
-rwxr-xr-xrepoman/bin/torrent-creator6
2 files changed, 13 insertions, 4 deletions
diff --git a/admin/Sources/Services/opengnsys.default b/admin/Sources/Services/opengnsys.default
index 9af83e29..a70d2b74 100644
--- a/admin/Sources/Services/opengnsys.default
+++ b/admin/Sources/Services/opengnsys.default
@@ -1,12 +1,17 @@
# RUN_OGADMSERVER defined as OpenGnsys Admin Server
# RUN_OGADMREPO defined as OpenGnsys Repository Manager
-# RUN_OGADMAGENT run task scheduler service
-# RUN_BTTRACKER run Bittorrent Tracker
-# RUN_BTSEEDER start seeding of selected torrent files
+# RUN_OGADMAGENT run task scheduler service (only if Admin Server is enabled)
+# RUN_BTTRACKER run Bittorrent Tracker (only if Repository is enabled)
+# RUN_BTSEEDER start seeding of selected torrent files (only if Repository is enabled)
+# BTSEEDER_PRIORITY nice priority to seed torrent files; recommended values:
+# 8 for Admin Server or Repo without Torrent
+# 0 for Admin Server and Repo with Torrent
+# -8 for Repo with Torrent
# RUN_CRON run Cron script to check started processes
RUN_OGADMSERVER="yes"
RUN_OGADMREPO="yes"
RUN_OGADMAGENT="yes"
RUN_BTTRACKER="yes"
RUN_BTSEEDER="yes"
+BTSEEDER_PRIORITY=0
RUN_CRONJOB="yes"
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