dropbear: add ForceCommand uci option
[openwrt/openwrt.git] / package / network / services / dropbear / files / dropbear.init
index ea4cad2a8d5489500186b52c68c13bd0ea54a31d..b82e967cbcedc4564dba6cfccc1383f7b7fa499f 100755 (executable)
@@ -119,6 +119,7 @@ validate_section_dropbear()
                'enable:bool:1' \
                'Interface:string' \
                'GatewayPorts:bool:0' \
+               'ForceCommand:string' \
                'RootPasswordAuth:bool:1' \
                'RootLogin:bool:1' \
                'rsakeyfile:file' \
@@ -158,6 +159,7 @@ dropbear_instance()
        procd_set_param command "$PROG" -F -P "$pid_file"
        [ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
        [ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
+       [ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
        [ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
        [ "${RootLogin}" -eq 0 ] && procd_append_param command -w
        if [ -n "${rsakeyfile}" ]; then