Advertisement
crabbypup

ha-manager to json

Jan 31st, 2023
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.30 KB | None | 0 0
  1. echo -e "[\n$(ha-manager config)\n]" | sed -e 's/\t//' -e 's/ /:/' -e 's/:/":/' -e 's/^vm/   {\n      "&/' -e 's/^ct/   {\n      "&/' -e 's/state.*/&\n   },/' -e '/^$/d' -e 's/^[a-z]/      "&/' -e 's/\:[p]*[0-9]*$/&,/' -e 's/\(started\)/"\1"/' -e 's/\(stopped\)/"\1"/' -e '0,/^{/s/^{/\[\n&/' -e 's/p[0-9]/"&"/'
  2.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement