Print html with lynx instead of curl

This commit is contained in:
Maniack Crudelis 2017-11-11 17:27:44 +01:00
parent b7c5649451
commit abb6d1e7cf
3 changed files with 13 additions and 6 deletions

View file

@ -254,6 +254,13 @@ EOF
# Give the execution right
chmod +x "$script_dir/upgrade_script.sh"
# Temporary upgrade fix
# Check if lynx is already installed.
if [ ! -e "$(which lynx)" ]
then
sudo apt-get install -y lynx
fi
# Start the upgrade script by replacement of this process
exec "$script_dir/upgrade_script.sh"
fi

View file

@ -71,8 +71,8 @@ echo -e "\e[1m> Update et install lxc lxctl\e[0m" | tee "$LOG_BUILD_LXC"
sudo apt-get update >> "$LOG_BUILD_LXC" 2>&1
sudo apt-get install -y lxc lxctl >> "$LOG_BUILD_LXC" 2>&1
echo -e "\e[1m> Install git curl\e[0m" | tee "$LOG_BUILD_LXC"
sudo apt-get install -y git curl >> "$LOG_BUILD_LXC" 2>&1
echo -e "\e[1m> Install git, curl and lynx\e[0m" | tee "$LOG_BUILD_LXC"
sudo apt-get install -y git curl lynx >> "$LOG_BUILD_LXC" 2>&1
sudo mkdir -p /var/lib/lxcsnaps # Créer le dossier lxcsnaps, pour s'assurer que lxc utilisera ce dossier, même avec lxc 2.

View file

@ -288,10 +288,10 @@ CHECK_URL () {
ECHO_FORMAT "The connection attempt fall on nginx default page.\n" "white" "bold" clog
fi
# Print the first 20 lines of the body
ECHO_FORMAT "Extract of the body:\n" "white"
echo -e "\e[37m" # Write in 'light grey'
grep "<body" --after-context=20 "$script_dir/url_output" | sed 1d | tee --append "$test_result"
# Print the first 20 lines of the page
ECHO_FORMAT "Extract of the page:\n" "white"
echo -en "\e[37m" # Write in 'light grey'
lynx -dump -force_html "$script_dir/url_output" | head --lines 20 | tee --append "$test_result"
echo -e "\e[0m"
fi
fi