2023-02-23 06:22:25 +01:00
|
|
|
VERSION=1
|
|
|
|
|
2023-03-01 08:15:29 +01:00
|
|
|
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
|
2023-02-23 06:22:25 +01:00
|
|
|
|
|
|
|
# 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
|