Update server-side/step2_as_user_without_sudo.sh
This commit is contained in:
parent
bea81cc2f1
commit
682c7b079d
1 changed files with 8 additions and 10 deletions
|
|
@ -4,22 +4,20 @@
|
|||
|
||||
############################################################################
|
||||
# #
|
||||
# Generate server-side SSH keys as the Linux user #
|
||||
# Check for IPv6 #
|
||||
# #
|
||||
############################################################################
|
||||
URL="https://loopsofzen.uk"
|
||||
VARIABLE_A="output.txt"
|
||||
STRING_TO_TEST="<html><title>Loops of Zen</title>"
|
||||
# Check for assigned IPv6 addresses
|
||||
ipv6_addresses=$(ip -6 addr show | grep -oP 'inet6 \K[0-9a-fA-F:]{1,}')
|
||||
|
||||
# Curl to get the page
|
||||
curl -o "$VARIABLE_A" "$URL"
|
||||
|
||||
# Check if the first line contains the $THIS string
|
||||
FIRST_LINE=$(head -n 1 "$VARIABLE_A")
|
||||
if [ "$FIRST_LINE" = "$STRING_TO_TEST" ]; then
|
||||
if [[ -n "$ipv6_addresses" ]]; then
|
||||
echo "IPv6 is enabled. Addresses:"
|
||||
echo "$ipv6_addresses"
|
||||
IPV6_TEST_RESULT="IPv6 Enabled"
|
||||
else
|
||||
echo "IPv6 is not enabled."
|
||||
IPV6_TEST_RESULT="IPv6 not detected. IPv4 Only"
|
||||
|
||||
fi
|
||||
############################################################################
|
||||
# #
|
||||
|
|
|
|||
Loading…
Reference in a new issue