openwrt/defaults/50-dropbear
Peter Šurda 7b3a05217c
Refactor and cleanup defaults
- 49-network is now using versioning
- 50-dropbear will make sure dropbear runs even if no version bump
  happened
2023-03-01 08:15:29 +01:00

24 lines
524 B
Plaintext

VERSION=1
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
/sbin/uci set defaults.version.dropbear="$VERSION"
/sbin/uci -q batch << EOF
set defaults.version.dropbear="$VERSION"
commit defaults
set dropbear.@dropbear[0].PasswordAuth='off'
set dropbear.@dropbear[0].RootPasswordAuth='off'
commit dropbear
EOF
/sbin/service dropbear enable
/sbin/service dropbear restart