Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Just a proposal: to ease the script writing it could accept input from stdin.
- Your example could be more readable written in bash like this (uses bash heredoc syntax):
- SESSION=$(vycli setupSession)
- vycli --session=$SESSION --read-stdin << EndOfFile
- configure
- set "system host-name vyos"
- delete "system name-server 192.0.2.1"
- commit
- exists "service dhcp-server"
- commit returnValue "system host-name"
- EndOfFile
- vycli --session=$SESSION --format=json show "interfaces ethernet"
- Also, you could save a file with the commands and do this:
- vycli --session=$SESSION --read-stdin < myfile
- vycli --session=$SESSION --format=json show "interfaces ethernet"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement