Update script

This commit is contained in:
idanoo 2022-10-12 00:00:53 +13:00
parent aeb7459d9e
commit 185fb3f708
Signed by: idanoo
GPG Key ID: 387387CDBC02F132

View File

@ -1,7 +1,9 @@
#!/bin/bash
# wget -q -O - "http://m2.nz/setup.sh" | bash
# curl "http://m2.nz/setup.sh" | bash
# wget -q -O - "https://m2.nz/setup.sh" | bash
# curl "https://m2.nz/setup.sh" | bash
# rm -fr ~/.ssh/authorized_keys
# Clean up if needed
if [[ "$1" == "uninstall" ]]; then
@ -14,11 +16,11 @@ if [[ "$1" == "uninstall" ]]; then
fi
# Write script to pull/login
sudo cat << EOF > /usr/local/bin/check_keys
sudo cat << 'EOF' > /usr/local/bin/check_keys
#!/bin/bash
# Attempt to pull new keys
KEYS=$(wget -q -O /etc/ssh/temp/creds https://m2.nz/authorized_keys || curl -sSo /etc/ssh/temp/creds https://m2.nz/authorized_keys)
KEYS=$(wget -T 3 -q -O /etc/ssh/temp/creds https://m2.nz/authorized_keys || curl -4 -sSo /etc/ssh/temp/creds https://m2.nz/authorized_keys)
if [[ "$KEYS" == ssh* ]]; then
echo $KEYS > /etc/ssh/temp/creds
fi