31 lines
510 B
Bash
Executable File
31 lines
510 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
ssh_user="admin"
|
|
|
|
ssh_host="${ssh_user}@192.168.2.1"
|
|
ssh_opts="-p 11422"
|
|
|
|
dns_domain=dafu.dev
|
|
dns_hostname=${1}
|
|
dns_ip=${2:-192.168.2.20}
|
|
|
|
. util.sh # import ssh function after options are set
|
|
|
|
|
|
fg_add_dns_script="
|
|
execute batch start
|
|
config system dns-database
|
|
edit \"${dns_domain}\"
|
|
config dns-entry
|
|
edit 0
|
|
set hostname \"${dns_hostname}\"
|
|
set ip \"${dns_ip}\"
|
|
end
|
|
end
|
|
execute batch end
|
|
execute batch lastlog
|
|
"
|
|
|
|
run_ssh_script "${fg_add_dns_script}"
|
|
|