mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-03 23:57:17 -04:00
Handle missing section and option errors on startup
Former-commit-id: 0729eb0432f1974f1957bd0eb146d287a36c43da Former-commit-id: 60d0a88bf87fb87580b36feedecbf0b4a82215fd
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from configparser import ConfigParser, NoSectionError, NoOptionError
|
from configparser import ConfigParser, NoOptionError, NoSectionError
|
||||||
from os import chmod, environ, listdir, walk
|
from os import chmod, environ, listdir, walk
|
||||||
from os.path import expanduser, isdir, isfile, realpath
|
from os.path import expanduser, isdir, isfile, realpath
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -646,7 +646,7 @@ if __name__ == "__main__":
|
|||||||
ssh_error = int(sshyp_data.get('CLIENT-ONLINE', 'ssh_error'))
|
ssh_error = int(sshyp_data.get('CLIENT-ONLINE', 'ssh_error'))
|
||||||
if ssh_error == 1:
|
if ssh_error == 1:
|
||||||
ssh_error = copy_id_check(port, username_ssh, ip, client_device_id, sshyp_data)
|
ssh_error = copy_id_check(port, username_ssh, ip, client_device_id, sshyp_data)
|
||||||
except (FileNotFoundError):
|
except (FileNotFoundError, NoSectionError, NoOptionError):
|
||||||
print(f"\n{73*'!'}")
|
print(f"\n{73*'!'}")
|
||||||
print("not all necessary configurations have been made - please run 'sshyp init'")
|
print("not all necessary configurations have been made - please run 'sshyp init'")
|
||||||
print(f"{73*'!'}\n")
|
print(f"{73*'!'}\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user