Command scripting
• 今まで
•show コマンド
#!/bin/vbash
shopt -s expand_aliases
. /etc/bash_completion.d/vyatta-op
show system time-zone
• set コマンド
#!/bin/vbash
WRAPPER=/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper
. /etc/bash_completion
$WRAPPER begin
$WRAPPER set system time-zone Asia/Tokyo
$WRAPPER commit
$WRAPPER save
$WRAPPER end
Hack してる感≒無理やり感がある
12.
Command scripting
• VyOS1.0.0 以降
• show コマンド
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
show system time-zone
• set コマンド
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
begin
set system time-zone Asia/Tokyo
commit
save
end