]> git.treefish.org Git - photosort.git/commitdiff
set exit status
authorAlexander Schmidt <alex@treefish.org>
Mon, 19 Oct 2020 12:40:39 +0000 (14:40 +0200)
committerAlexander Schmidt <alex@treefish.org>
Mon, 19 Oct 2020 12:40:39 +0000 (14:40 +0200)
src/photosort-daemon.py

index cdd652d2efac171025737402bb9f87239686b4dc..7e91b32f2490787a280e56319f3bdcaba586a68b 100755 (executable)
@@ -5,6 +5,7 @@ import json
 import logging
 import os
 import signal
+import sys
 import time
 
 from bunch import Bunch
@@ -30,6 +31,8 @@ logging.basicConfig(format='[%(asctime)s] %(levelname)s: %(message)s',
                     level=logging.getLevelName(args.log_lvl),
                     datefmt='%m/%d/%Y %H:%M:%S')
 
+status = 0
+
 with open(args.config_file) as f:
     cfg = json.load(f)
 
@@ -37,7 +40,6 @@ bunches = []
 for bunch_cfg in cfg['bunches']:
     bunches.append( Bunch(bunch_cfg) )
 
-
 for bunch in bunches:
     bunch.start()
 
@@ -45,7 +47,10 @@ while not stop:
     for bunch in bunches:
         if not bunch.is_running():
             stop = True
+            status = 1
     time.sleep(2.0)
 
 for bunch in bunches:
     bunch.stop()
+
+sys.exit(status)