2017-07-21 15:22:26 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
##################################### < CONFIGURATION > #####################################
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
gateway=$(ip route | grep default | awk '{print $3}')
|
2017-07-21 15:22:26 -06:00
|
|
|
|
|
|
|
#Colors
|
|
|
|
white="\033[1;37m"
|
|
|
|
red="\033[1;31m"
|
|
|
|
blue="\033[1;34m"
|
|
|
|
transparent="\e[0m"
|
|
|
|
|
|
|
|
#############################################################################################
|
|
|
|
|
|
|
|
clear
|
|
|
|
echo -e "$red[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]"
|
|
|
|
echo -e "$red Prepare router page."
|
|
|
|
echo -e "$blue[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]""$transparent"
|
|
|
|
echo "[i] Prepare dep."
|
|
|
|
|
|
|
|
# Check which package manager is installed
|
|
|
|
echo "Package Manager"
|
|
|
|
if hash pacman 2>/dev/null; then
|
2017-12-31 09:02:12 -07:00
|
|
|
PACK="pacman -S"
|
2017-07-21 15:22:26 -06:00
|
|
|
else
|
2017-12-31 09:02:12 -07:00
|
|
|
if hash apt-get 2>/dev/null; then
|
|
|
|
PACK="apt-get install"
|
|
|
|
else
|
|
|
|
if hash yum 2>/dev/null; then
|
|
|
|
PACK="yum install"
|
2017-07-21 15:22:26 -06:00
|
|
|
fi
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
2017-07-21 15:22:26 -06:00
|
|
|
fi
|
|
|
|
sleep 0.025
|
|
|
|
echo "================================================================================="
|
|
|
|
|
|
|
|
echo -ne "Httrack........."
|
|
|
|
if ! hash httrack 2>/dev/null; then
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "\e[1;31mNot installed"$transparent""
|
|
|
|
$PACK httrack
|
2017-07-21 15:22:26 -06:00
|
|
|
else
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "\e[1;32mOK!"$transparent""
|
2017-07-21 15:22:26 -06:00
|
|
|
fi
|
|
|
|
sleep 0.025
|
|
|
|
echo "================================================================================="
|
|
|
|
|
|
|
|
echo -ne "cutycapt........"
|
|
|
|
if ! hash httrack 2>/dev/null; then
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "\e[1;31mNot installed"$transparent""
|
|
|
|
$PACK cutycapt
|
2017-07-21 15:22:26 -06:00
|
|
|
else
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "\e[1;32mOK!"$transparent""
|
2017-07-21 15:22:26 -06:00
|
|
|
fi
|
|
|
|
sleep 0.025
|
|
|
|
echo "================================================================================="
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ ! -d sites ]; then
|
|
|
|
mkdir sites
|
2017-07-21 15:22:26 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
#############################################################################################
|
|
|
|
echo "[i] Download preview picture"
|
|
|
|
cutycapt --url=http://$gateway --out=sites/$(date | awk '{print $4}').png
|
|
|
|
echo "================================================================================="
|
|
|
|
|
|
|
|
cd sites
|
|
|
|
echo "[i] Download router site"
|
|
|
|
httrack $gateway
|
|
|
|
echo "================================================================================="
|
|
|
|
echo "[I] DONE"
|