Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
38a0e591
Commit
38a0e591
authored
Feb 15, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
route-update.sh: support comments in gateway and table files
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
f340b0e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
route-update.sh
router/route-update.sh
+6
-6
No files found.
router/route-update.sh
View file @
38a0e591
...
...
@@ -68,29 +68,29 @@ read_group_config()
gw
=
""
;
table
=
""
;
route_via
=
""
if
[
-f
"
$dir
/gateway"
]
;
then
read
-r
gw <
"
$dir
/gateway"
gw
=
$(
grep
-v
'^#'
"
$dir
/gateway"
|
grep
-m1
.
)
else
echo
"[
$(
basename
"
$dir
"
)
] No gateway file, skipping"
>
&2
return
1
fi
if
[
-f
"
$dir
/table"
]
;
then
read
-r
table <
"
$dir
/table"
table
=
$(
grep
-v
'^#'
"
$dir
/table"
|
grep
-m1
.
)
else
echo
"[
$(
basename
"
$dir
"
)
] No table file, skipping"
>
&2
return
1
fi
# Build route suffix: single vs multipath
local
gw_count
=
$(
grep
-
c
.
"
$dir
/gateway"
)
local
gw_count
=
$(
grep
-
v
'^#'
"
$dir
/gateway"
|
grep
-c
.
)
if
[
"
$gw_count
"
-le
1
]
;
then
route_via
=
"via
$gw
table
$table
"
else
route_via
=
"table
$table
"
while
read
-r
g
;
do
[
-n
"
$g
"
]
||
continue
local
g
for
g
in
$(
grep
-v
'^#'
"
$dir
/gateway"
|
grep
.
)
;
do
route_via
=
"
$route_via
nexthop via
$g
weight 1"
done
<
"
$dir
/gateway"
done
fi
}
...
...
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