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
79cdae92
Commit
79cdae92
authored
Feb 17, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
route-update.sh: add --help with detailed parameter descriptions
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
d8d93ef2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
route-update.sh
router/route-update.sh
+57
-0
No files found.
router/route-update.sh
View file @
79cdae92
...
...
@@ -6,6 +6,7 @@
# route-update.sh --add IP|DOMAIN GROUP
# route-update.sh --del IP|DOMAIN GROUP
# route-update.sh --flush GROUP
# route-update.sh --help
cd
"
$(
dirname
"
$(
realpath
"
$0
"
)
"
)
"
||
exit
...
...
@@ -27,6 +28,61 @@ ADD_DEL_TARGET=
ADD_DEL_GROUP
=
FLUSH_GROUP
=
show_help
()
{
cat
<<
'
HELP
'
route-update.sh — declarative policy routing via directory-based config
Reads routes.d/ (IPv4) and routes6.d/ (IPv6) directories. Each subdirectory
is a route group containing gateway, table, and .list symlink files.
MODES OF OPERATION:
(no args) Process all groups, skip unchanged (default mode).
Detects changes via MD5 hash of .list + gateway + table files.
Automatically reloads groups if ip rules/routes are lost
or route count drops more than 1% from expected.
--resolve Re-resolve DNS in all groups. Routes are reloaded only
if resolved IPs actually changed.
--force Reload all groups unconditionally (flush + reload).
--show Dry-run: show what would be done without making changes.
Can be combined with other flags.
--set-rules Only create ip rules for all groups (no route loading).
Useful after network restart to restore rules quickly.
--flush GROUP Flush all routes in the specified group's table and exit.
--add IP|DOMAIN GROUP
Add a route for IP or domain to the group immediately.
Domains are resolved to IPs first. Does not modify .list files.
--del IP|DOMAIN GROUP
Remove a route for IP or domain from the group's table.
--verbose, -v Show detailed progress: hashes, route counts, skip reasons.
Can be combined with any mode.
--help, -h Show this help and exit.
DIRECTORY STRUCTURE:
routes.d/GROUP/gateway Gateway IP(s), one per line. "default" = default gw.
Multiple lines = multipath (per-flow balancing).
routes.d/GROUP/table Routing table number. ip rule pref = table × 10.
routes.d/GROUP/*.list Symlinks to files with IPs, subnets, or domains.
routes6.d/ Same structure for IPv6 groups.
EXAMPLES:
./route-update.sh # normal run
./route-update.sh --resolve -v # re-resolve DNS, verbose
./route-update.sh --add example.com egw
./route-update.sh --flush ogw
HELP
exit
0
}
while
[
-n
"
$1
"
]
;
do
case
"
$1
"
in
--force
)
FORCE
=
1
;;
...
...
@@ -34,6 +90,7 @@ while [ -n "$1" ] ; do
--show
)
SHOW
=
1
;;
--set-rules
)
SET_RULES
=
1
;;
--verbose
|
-v
)
VERBOSE
=
1
;;
--help
|
-h
)
show_help
;;
--flush
)
FLUSH_GROUP
=
"
$2
"
;
shift
;;
--add
)
ACTION
=
add
;
ADD_DEL_TARGET
=
"
$2
"
;
ADD_DEL_GROUP
=
"
$3
"
;
shift
2
;;
--del
)
ACTION
=
del
;
ADD_DEL_TARGET
=
"
$2
"
;
ADD_DEL_GROUP
=
"
$3
"
;
shift
2
;;
...
...
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