diff options
Diffstat (limited to 'vcp')
-rwxr-xr-x | vcp | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -26,6 +26,29 @@ _netcup_vcp_cmd_kvmInformation() { -q page=vServerKVMGeneral \ -q section=kvmInformation \ -q selectedVServerId="$1" + + text=$(w3m -T text/html -dump -cols 4096 "$_netcup_vcp_content_cache") + vsname=$(echo "$text" | sed -n 's/^vServer-Name\s*\(\S\+\).*/\1/p') \ + state=$(echo "$text" | sed -n 's/^Status\s*\(\S\+\).*/\1/p') \ + boot_device=$(echo "$text" | sed -n 's/^Startlaufwerk\s*\(\S\+\).*/\1/p') \ + attached_iso=$(echo "$text" | sed -n 's/^Momentan eingelegt:\s*\(\S\+\).*/\1/p') \ + net1_mac=$(echo "$text" | grep '^1\s' | awk '{print$2}') \ + net1_ipv4=$(echo "$text" | grep '^1\s' | awk '{print$3}') \ + net1_ipv6=$(echo "$text" | grep '^1\s' | awk '{print$4}') \ + ftp_host=$(echo "$text" | sed -n 's/^Hostname:\s*\(\S\+\).*/\1/p') \ + ftp_user=$(echo "$text" | sed -n 's/^Benutzername:\s*\(\S\+\).*/\1/p') \ + ftp_pass=$(echo "$text" | sed -n 's/^Passwort:\s*\(\S\+\).*/\1/p') \ + jq -n '{ + vsname: env.vsname, + state: { gestartet: "online", gestoppt: "offline" }[env.state], + boot_device: env.boot_device, + attached_iso: + (if env.attached_iso == "n/a" then null else env.attached_iso end), + network: [ + { mac: env.net1_mac, ipv4: env.net1_ipv4, ipv6: env.net1_ipv6 } + ], + ftp: { host: env.ftp_host, pass: env.ftp_pass, user: env.ftp_user } + }' } # attachCdrom : VServerID, ImageName -> TODO |