improve config file handling
This commit is contained in:
1 parent
45239c4c6a
commit
1469243b54
3 files changed
+8
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
snapraid-runner.conf
|
||||||
@@ -15,6 +15,8 @@ maxsize = 5000
|
|||||||
[email]
|
[email]
|
||||||
; when to send an email, comma-separated list of [success, error]
|
; when to send an email, comma-separated list of [success, error]
|
||||||
sendon = success,error
|
sendon = success,error
|
||||||
|
; set to false to get full programm output via email
|
||||||
|
short = true
|
||||||
subject = [SnapRAID] Status Report:
|
subject = [SnapRAID] Status Report:
|
||||||
from =
|
from =
|
||||||
to =
|
to =
|
||||||
@@ -165,6 +165,11 @@ def main():
|
|||||||
help="Configuration file (default %(default)s)")
|
help="Configuration file (default %(default)s)")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not os.path.exists(args.conf):
|
||||||
|
print("snapraid-runner configuration file not found")
|
||||||
|
args.print_help()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
load_config(args.conf)
|
load_config(args.conf)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in new issue
Block a user