Refactor and cleanup defaults

- 49-network is now using versioning
- 50-dropbear will make sure dropbear runs even if no version bump
  happened
This commit is contained in:
Peter Šurda 2023-03-01 08:15:29 +01:00
parent e03f2fc84f
commit 7b3a05217c
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95
2 changed files with 12 additions and 4 deletions

View File

@ -1,7 +1,9 @@
[ "$(uci -q get luci.diag.dns)" = "bitmessage.org" ] && exit 0 VERSION=1
# make a significant change [ "$(uci -q get defaults.version.network)" -ge "$VERSION" ] & exit
/sbin/uci set luci.diag.dns='bitmessage.org'
# save version
/sbin/uci set defaults.version.network="$VERSION"
# switch LAN to eth1 # switch LAN to eth1
/sbin/uci set network.@device[0].ports='eth1' /sbin/uci set network.@device[0].ports='eth1'

View File

@ -1,6 +1,12 @@
VERSION=1 VERSION=1
[ "$(uci -q get defaults.version.dropbear)" -ge "$VERSION" ] && exit 0 if [ "$(uci -q get defaults.version.dropbear)" -ge "$VERSION" ]
then
# may leave dropbear off after an upgrade
/sbin/service dropbear enable
/sbin/service dropbear restart
exit 0
fi
# save version # save version
/sbin/uci set defaults.version.dropbear="$VERSION" /sbin/uci set defaults.version.dropbear="$VERSION"