openwrt/defaults/50-dropbear

24 lines
524 B
Plaintext
Raw Permalink Normal View History

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