Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eterban
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eterban
Commits
cad9cdbd
Commit
cad9cdbd
authored
Jul 26, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gateway: fail on invalid switcher configuration
parent
13a760fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
eterban_switcher.py
gateway/usr/share/eterban/eterban_switcher.py
+4
-4
No files found.
gateway/usr/share/eterban/eterban_switcher.py
View file @
cad9cdbd
...
@@ -36,7 +36,7 @@ except OSError:
...
@@ -36,7 +36,7 @@ except OSError:
log
=
open
(
path_to_log
,
'a'
)
log
=
open
(
path_to_log
,
'a'
)
except
OSError
:
except
OSError
:
print
(
"Unknown error with logfile"
)
print
(
"Unknown error with logfile"
)
sys
.
exit
()
sys
.
exit
(
1
)
def
parse_config
(
path_to_config
,
path_to_log
):
def
parse_config
(
path_to_config
,
path_to_log
):
...
@@ -45,7 +45,7 @@ def parse_config (path_to_config, path_to_log):
...
@@ -45,7 +45,7 @@ def parse_config (path_to_config, path_to_log):
info
+=
' '
+
'Problem in config file ('
+
path_to_config
+
'). Check him!'
info
+=
' '
+
'Problem in config file ('
+
path_to_config
+
'). Check him!'
with
open
(
path_to_log
,
"a"
)
as
log_file
:
with
open
(
path_to_log
,
"a"
)
as
log_file
:
log_file
.
write
(
info
)
log_file
.
write
(
info
)
sys
.
exit
()
sys
.
exit
(
1
)
config
=
configparser
.
ConfigParser
()
config
=
configparser
.
ConfigParser
()
config
.
read
(
path_to_config
)
config
.
read
(
path_to_config
)
...
@@ -96,14 +96,14 @@ def parse_config (path_to_config, path_to_log):
...
@@ -96,14 +96,14 @@ def parse_config (path_to_config, path_to_log):
info
+=
" Problem in config file ("
+
path_to_config
+
"): "
+
str
(
error
)
+
"
\n
"
info
+=
" Problem in config file ("
+
path_to_config
+
"): "
+
str
(
error
)
+
"
\n
"
with
open
(
path_to_log
,
"a"
)
as
log_file
:
with
open
(
path_to_log
,
"a"
)
as
log_file
:
log_file
.
write
(
info
)
log_file
.
write
(
info
)
sys
.
exit
()
sys
.
exit
(
1
)
if
redis_server
==
"redis_server"
or
ban_server
==
"ban_server"
or
not
wan_ifaces
:
if
redis_server
==
"redis_server"
or
ban_server
==
"ban_server"
or
not
wan_ifaces
:
info
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
())
info
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
())
info
+=
' '
+
'Problem in config file ('
+
path_to_config
+
'). Check him!'
info
+=
' '
+
'Problem in config file ('
+
path_to_config
+
'). Check him!'
with
open
(
path_to_log
,
"a"
)
as
log_file
:
with
open
(
path_to_log
,
"a"
)
as
log_file
:
log_file
.
write
(
info
)
log_file
.
write
(
info
)
sys
.
exit
()
sys
.
exit
(
1
)
else
:
else
:
return
(
redis_server
,
ban_server
,
ban_server_ipv6
,
wan_ifaces
,
internal_interface
,
maxelem
,
whitelist_file
)
return
(
redis_server
,
ban_server
,
ban_server_ipv6
,
wan_ifaces
,
internal_interface
,
maxelem
,
whitelist_file
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment