commit fee229714dc786c5fa2a4fb9b4fb6a2af15513cc parent b7671288439953b0a1844af1abd3046bd5062c74 Author: pyratebeard <root@pyratebeard.net> Date: Wed, 10 Jan 2024 13:54:38 +0000 add ip output. add dnsutils and sort pkg list Diffstat:
M | forge | | | 15 | +++++++++++---- |
M | playbook.yml | | | 3 | ++- |
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/forge b/forge @@ -59,9 +59,16 @@ _echo "let's play" ansible-playbook playbook.yml _echo "forge complete" -srm -drvl /etc/ssh/hostca-key -srm -dvrl /tmp/setup -srm -dvrl /tmp/bw.zip -srm -dvrl /usr/local/bin/bw +LIP=$(ip a s $(ip r | grep default | grep -oP '(?<=dev )[^ ]*') | awk '/inet\ / {print $2}' | awk -F/ '{print $1}') +RIP=$(dig -4 ip @dns.toys | awk '/^ip./ {print $NF}' | tr -d '"') +echo "local addr: $LIP" +echo "remote addr: $RIP" + +_echo "cleanup" +bw logout +rm -rf /tmp/bw.zip &>/dev/null +rm -rf /usr/local/bin/bw &>/dev/null +srm -drvl /etc/ssh/hostca-* &>/dev/null +srm -dvrl /tmp/setup &>/dev/null srm -dvrl "$0" &>/dev/null reboot diff --git a/playbook.yml b/playbook.yml @@ -23,10 +23,11 @@ - bash - coreutils - curl - - python3-pexpect + - dnsutils - git - gnupg - gpg + - python3-pexpect - secure-delete - stow - sudo