Skip to content

Commit

Permalink
Update unite_the_clans2.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ZPXD authored Feb 19, 2022
1 parent d61facb commit 335e146
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions pomocnicze_skrypty/unite_the_clans2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,69 @@
#
# NEW_USER=ja_xd
# DOMENA=TU_WSTAW_NAZWE_SWOJEJ_DOMENY

# 3. Odpal skrypt
#
# wget

# Zmienne.
the_user=$1


wget_output=$(wget -q "$DOMENA")
if [ $? -ne 0 ]; then
echo "OK, nie masz flagi - lecimy dalej"
else
echo "MASZ JUZ FLAGE, ANULUJEMY SKRYPT!!!!!!!!"
exit "MASZ JUZ FLAGE"
fi

#test IP domeny
HOST=$(host $DOMENA | awk '{ print $4 }')

#twoje aktualne IP
IP=$(curl -s http://checkip.amazonaws.com/)

echo ""
echo "wpisana domena: $DOMENA"
echo ""

if [ "$IP" = "$HOST" ]
then
echo "domena jest OK"
else
echo "domena jest zla"
fi

echo "twoje IP:"
echo "$IP"
echo "rekord A z domeny:"
echo "$HOST"

wget_output=$(wget -q "$DOMENA")
if [ $? -ne 0 ]; then
echo "HTTP error"
else
echo "HTTP OK"
fi




# Nazwa użytkownika

while true; do
read -p "Podaj nazwę użytkownika jaką chcesz mieć na tym serwerze:" yn
case $yn in
[Yy]* ) make install; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done

echo "Podaj nazwę użytkownika jaką chcesz mieć na tym serwerze:"

read the_user


domena=$2
klucz=xd_$1
flaga_start=`pwd`/flaga
Expand Down

0 comments on commit 335e146

Please sign in to comment.