projects
/
smailq.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smailq: Look for global configuration under /etc
[smailq.git]
/
smailq
diff --git
a/smailq
b/smailq
index def0a0a9c312d490727d2f455104d416f2a4e5e6..d719d43a283e916d2a15299ba3a5218242eee328 100755
(executable)
--- a/
smailq
+++ b/
smailq
@@
-395,7
+395,7
@@
OPTIONS:
if __name__ == "__main__":
if __name__ == "__main__":
- conffn
= os.path.expanduser("~/.smailq.conf")
+ conffn
_list = [os.path.expanduser("~/.smailq.conf"), "/etc/smailq.conf"]
cmd = "--list"
nooptargs = []
cmd = "--list"
nooptargs = []
@@
-416,7
+416,7
@@
if __name__ == "__main__":
'--deliver']:
cmd = opt
elif opt in ['-C', '--config']:
'--deliver']:
cmd = opt
elif opt in ['-C', '--config']:
- conffn
= arg
+ conffn
_list = [arg]
elif opt in ['-v', '--verbose']:
verbose = True
quiet = False
elif opt in ['-v', '--verbose']:
verbose = True
quiet = False
@@
-432,8
+432,9
@@
if __name__ == "__main__":
sys.exit(os.EX_USAGE)
# Reading config file
sys.exit(os.EX_USAGE)
# Reading config file
- if not os.path.isfile(conffn):
- printerr("No such config file:", conffn)
+ conffn = next((f for f in conffn_list if os.path.isfile(f)), None)
+ if conffn is None:
+ printerr("No config file found: " + str(conffn_list))
sys.exit(os.EX_IOERR)
conf = None
try:
sys.exit(os.EX_IOERR)
conf = None
try: