这问题讨论了如何在 EdgeRouter 上运行的 EdgeOS 中设置 gui 和 ssh 监听地址。我想在进行更改之前检查当前配置,并学习将来检查其他设置的语法。
给出这个例子...
configure
set service gui listen-address 10.0.0.1
set service ssh listen-address 10.0.0.1
commit
save
exit
...在设置这些值之前我该如何检查它们?我认为下面的方法可行...
configure
check service gui listen-address 10.0.0.1
check service ssh listen-address 10.0.0.1
exit
运行后help
,我看到以下内容......
root@ubnt# help
GNU bash, version 4.1.0(2)-release (mipsel-unknown-linux-gnu)
These shell commands are defined internally. Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.
A star (*) next to a name means that the command is disabled.
job_spec [&] if COMMANDS; then COMMANDS; [ elif C>
(( expression )) kill [-s sigspec | -n signum | -sigs>
. filename [arguments] let arg [arg ...]
: local [option] name[=value] ...
[ arg... ] logout [n]
[[ expression ]] mapfile [-n count] [-O origin] [-s c>
alias [-p] [name[=value] ... ] popd [-n] [+N | -N]
bind [-lpvsPVS] [-m keymap] [-f filen> printf [-v var] format [arguments]
break [n] pushd [-n] [+N | -N | dir]
builtin [shell-builtin [arg ...]] pwd [-LP]
caller [expr] read [-ers] [-a array] [-d delim] [->
case WORD in [PATTERN [| PATTERN]...)> readarray [-n count] [-O origin] [-s>
cd [-L|-P] [dir] readonly [-af] [name[=value] ...] or>
command [-pVv] command [arg ...] return [n]
compgen [-abcdefuv] [-o option] > select NAME [in WORDS ... ;] do COMM>
complete [-abcdefuv] [-pr] [-DE] > set [--abefhkmnptuvxBCHP] [-o option>
compopt [-o|+o option] [-DE] [name ..> shift [n]
continue [n] shopt [-pqsu] [-o] [optname ...]
coproc [NAME] command [redirections] source filename [arguments]
declare [-aAfFilrtux] [-p] [name[=val> test [expr]
dirs [-clpv] [+N] [-N] time [-p] pipeline
echo [-neE] [arg ...] times
enable [-a] [-dnps] [-f filename] [na> trap [-lp] [[arg] signal_spec ...]
eval [arg ...] true
exec [-cl] [-a name] [command [argume> type [-afptP] name [name ...]
exit [n] typeset [-aAfFilrtux] [-p] name[=val>
export [-fn] [name[=value] ...] or ex> ulimit [-SHacdefilmnpqrstuvx] [limit>
false umask [-p] [-S] [mode]
fc [-e ename] [-lnr] [first] [last] o> unalias [-a] name [name ...]
for NAME [in WORDS ... ] ; do COMMAND> unset [-f] [-v] [name ...]
for (( exp1; exp2; exp3 )); do COMMAN> until COMMANDS; do COMMANDS; done
function name { COMMANDS ; } or name > variables - Names and meanings of so>
getopts optstring name [arg] wait [pid]
hash [-lr] [-p pathname] [-dt] [name > while COMMANDS; do COMMANDS; done
help [-dms] [pattern ...] { COMMANDS ; }
history [-c] [-d offset] [n] or histo>
...按下后Tab我会得到这个...
[edit]
root@ubnt#
comment copy load run
commit delete loadkey save
commit-confirm discard merge set
compare edit rename show
confirm exit rollback
[edit]
root@ubnt#
我遗漏了什么?我应该使用show
而不是 吗set
?(然后使用制表符完成我所讨论的变量?)
答案1
您应该使用show
,而且,您还可以使用它来查看配置部分的完整图片(或者如果不带参数发布,甚至可以查看完整的配置),而不仅仅是特定的值:
admin@maya:~$ configure
[edit]
admin@maya# show service dns
forwarding {
cache-size 150
listen-on eth0
listen-on eth0.10
}
[edit]
admin@maya# show service d
dhcp-server dns
[edit]
admin@maya# show service dns forwarding cache-size
cache-size 150
[edit]