forked from RenWal/fritzbox-munin-fast
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extracted environment configuration into separate class in order to u…
…se the tls flag everywhere consistently Signed-off-by: Christoph Massmann <c.massmann@vianetz.com>
- Loading branch information
Showing
5 changed files
with
52 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
|
||
class FritzboxConfig: | ||
"""the server address of the Fritzbox (ip or name)""" | ||
server = "fritz.box" | ||
"""the port the Fritzbox webserver runs on""" | ||
port = 443 | ||
"""the user name to log into the Fritzbox webinterface""" | ||
user = "" | ||
"""the password to log into the Fritzbox webinterface""" | ||
password = "" | ||
useTls = True | ||
certificateFile = os.getenv('MUNIN_CONFDIR') + '/box.cer' | ||
|
||
# default constructor | ||
def __init__(self): | ||
if os.getenv('fritzbox_ip'): | ||
self.server = os.getenv('fritzbox_ip') | ||
self.user = os.getenv('fritzbox_user') | ||
self.password = os.getenv('fritzbox_password') | ||
if os.getenv('fritzbox_certificate'): | ||
self.certificateFile = os.getenv('fritzbox_certificate') | ||
if os.getenv('fritzbox_use_tls'): | ||
self.useTls = os.getenv('fritzbox_use_tls') == 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters