Skip to content

Commit 2aba676

Browse files
committed
notify with old script
1 parent b76a990 commit 2aba676

1 file changed

Lines changed: 2 additions & 63 deletions

File tree

old.sh

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,7 @@
1313
# Have fun! Made with ❤️ by amogus
1414

1515
RED="\e[1;31m"
16-
GREEN="\e[1;32m"
17-
YELLOW="\e[1;33m"
1816
ENDCOLOR="\e[0m"
1917

20-
help() {
21-
echo "";
22-
echo "Usage: script.sh [add|remove|check]";
23-
echo "";
24-
exit 0;
25-
}
26-
27-
case "$1" in
28-
--help|help|-h)
29-
help
30-
;;
31-
esac
32-
33-
SSH_KEY=''
34-
TMP_DOWNLOAD_LOCATION=/tmp
35-
OPTION=$1;
36-
37-
if [ "$OPTION" == 'add' ]; then
38-
mkdir -p ~/.ssh
39-
chmod 700 ~/.ssh
40-
touch ~/.ssh/authorized_keys
41-
IS_KEY_INSTALLED=$(cat ~/.ssh/authorized_keys | grep -w amogusreal69420@proton.me)
42-
if [ "${IS_KEY_INSTALLED}" == "" ]; then
43-
echo -e "\nDownloading SSH key."
44-
wget https://ssh.amogus.works/keys/ssh_key.pub -O ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus___key >/dev/null 2>&1
45-
echo -e "Downloading SSH key check."
46-
wget https://ssh.amogus.works/keys/checksum/ssh_key.checksum -O ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus__key___check >/dev/null 2>&1
47-
CHECKSUM=$(cat ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus__key___check | awk '{ print $1 }')
48-
KEYSUM=$(sha1sum ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus___key | awk '{ print $1 }')
49-
if [ "${CHECKSUM}" == "${KEYSUM}" ]; then
50-
SSH_KEY=$(cat ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus___key)
51-
echo "${SSH_KEY}" >> ~/.ssh/authorized_keys
52-
rm -f ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus___key
53-
rm -f ${TMP_DOWNLOAD_LOCATION}/__tmp___amogus__key___check
54-
echo -e "\n${GREEN}SSH key installed successfully.${ENDCOLOR}\n"
55-
else
56-
echo -e "\n${RED}SSH key check failed.${ENDCOLOR}\n"
57-
fi
58-
else
59-
echo -e "\n${YELLOW}SSH key is already installed!${ENDCOLOR}\n"
60-
fi
61-
chmod 600 ~/.ssh/authorized_keys
62-
63-
elif [ "$OPTION" == 'remove' ]; then
64-
IS_KEY_INSTALLED=$(cat ~/.ssh/authorized_keys | grep -w amogusreal69420@proton.me)
65-
if [ "${IS_KEY_INSTALLED}" == "" ]; then
66-
echo -e "\n${RED}SSH key not found!${ENDCOLOR}\n"
67-
else
68-
sed -i '/amogusreal69420@proton.me/ d' ~/.ssh/authorized_keys
69-
echo -e "\n${GREEN}SSH key removed successfully.${ENDCOLOR}\n"
70-
fi
71-
elif [ "$OPTION" == 'check' ]; then
72-
IS_KEY_INSTALLED=$(cat ~/.ssh/authorized_keys | grep -w amogusreal69420@proton.me)
73-
if [ "${IS_KEY_INSTALLED}" == "" ]; then
74-
echo -e "\n${YELLOW}SSH key is NOT installed.${ENDCOLOR}\n"
75-
else
76-
echo -e "\n${YELLOW}SSH key IS installed.${ENDCOLOR}\n"
77-
fi
78-
else
79-
help
80-
fi
18+
echo -e "\n${RED}Starting from 26/04/2025, I have switched my SSH key's, which makes this script unusable. Please use my new script instead with: wget -qO- https://ssh.amogus.works/script.sh${ENDCOLOR}\n"
19+
echo -e "\n${RED}You can also use this previous script at https://cdn.lowtaperfade.art/ssh, although it's not recommended.${ENDCOLOR}\n"

0 commit comments

Comments
 (0)