forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ddns-script: add retry_max_count's upgrade script
Signed-off-by: FriesI23 Qin <[email protected]>
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
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
20 changes: 20 additions & 0 deletions
20
net/ddns-scripts/files/etc/uci-defaults/50-ddns-migrate-retry-count
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,20 @@ | ||
#!/bin/sh | ||
|
||
. /lib/functions.sh | ||
|
||
upgrade_to_retry_max_count() { | ||
local service=$1 | ||
local retry_count retry_max_count | ||
|
||
config_get retry_max_count $service retry_max_count | ||
config_get retry_count $service retry_count | ||
if [ -z "$retry_max_count" ] && [ -n "$retry_count" ]; then | ||
uci_set ddns $service retry_max_count $retry_count | ||
uci_commit ddns | ||
fi | ||
} | ||
|
||
config_load ddns | ||
config_foreach upgrade_to_retry_max_count service | ||
|
||
exit 0 |