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
f340b0e8
Commit
f340b0e8
authored
Feb 15, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
route-update.sh: include gateway/table in hash, detect gateway changes
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
b0a2f9fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
route-update.sh
router/route-update.sh
+7
-2
No files found.
router/route-update.sh
View file @
f340b0e8
...
@@ -188,8 +188,8 @@ process_routes()
...
@@ -188,8 +188,8 @@ process_routes()
continue
continue
fi
fi
# Compute hash of all list contents
# Compute hash of all list contents
+ gateway + table
local
current_hash
=
$(
md5_lists
$lists
)
local
current_hash
=
$(
md5_lists
"
$gwdir
/gateway"
"
$gwdir
/table"
$lists
)
if
[
-z
"
$FORCE
"
]
&&
[
-f
"
$STATE_DIR
/
$state
/hash"
]
;
then
if
[
-z
"
$FORCE
"
]
&&
[
-f
"
$STATE_DIR
/
$state
/hash"
]
;
then
local
saved_hash
local
saved_hash
...
@@ -228,11 +228,15 @@ process_routes()
...
@@ -228,11 +228,15 @@ process_routes()
# Check if resolved IPs actually changed
# Check if resolved IPs actually changed
if
[
-z
"
$FORCE
"
]
&&
[
-f
"
$STATE_DIR
/
$state
/resolved"
]
;
then
if
[
-z
"
$FORCE
"
]
&&
[
-f
"
$STATE_DIR
/
$state
/resolved"
]
;
then
if
diff
-q
"
$STATE_DIR
/
$state
/resolved"
"
$resolved_new
"
>
/dev/null 2>&1
;
then
if
diff
-q
"
$STATE_DIR
/
$state
/resolved"
"
$resolved_new
"
>
/dev/null 2>&1
;
then
# IPs same, but gateway may have changed
if
[
-f
"
$STATE_DIR
/
$state
/gateway"
]
&&
diff
-q
"
$STATE_DIR
/
$state
/gateway"
"
$gwdir
/gateway"
>
/dev/null 2>&1
;
then
log
"[
$name
]
$label
Resolved IPs unchanged, updating hash only"
log
"[
$name
]
$label
Resolved IPs unchanged, updating hash only"
echo
"
$current_hash
"
>
"
$STATE_DIR
/
$state
/hash"
echo
"
$current_hash
"
>
"
$STATE_DIR
/
$state
/hash"
rm
-f
"
$resolved_new
"
rm
-f
"
$resolved_new
"
continue
continue
fi
fi
log
"[
$name
]
$label
Gateway changed, reloading routes"
fi
fi
fi
local
count
=
$(
wc
-l
<
"
$resolved_new
"
)
local
count
=
$(
wc
-l
<
"
$resolved_new
"
)
...
@@ -260,6 +264,7 @@ process_routes()
...
@@ -260,6 +264,7 @@ process_routes()
# Save state
# Save state
echo
"
$current_hash
"
>
"
$STATE_DIR
/
$state
/hash"
echo
"
$current_hash
"
>
"
$STATE_DIR
/
$state
/hash"
echo
"
$table
"
>
"
$STATE_DIR
/
$state
/table"
echo
"
$table
"
>
"
$STATE_DIR
/
$state
/table"
cp
"
$gwdir
/gateway"
"
$STATE_DIR
/
$state
/gateway"
mv
"
$resolved_new
"
"
$STATE_DIR
/
$state
/resolved"
mv
"
$resolved_new
"
"
$STATE_DIR
/
$state
/resolved"
log
"[
$name
]
$label
Done"
log
"[
$name
]
$label
Done"
...
...
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