Skip to content

Commit

Permalink
Fix wrong redirection of PhantomJS error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsettrack4 authored Feb 20, 2019
1 parent 55b98e3 commit 944c890
Showing 1 changed file with 60 additions and 36 deletions.
96 changes: 60 additions & 36 deletions ztvh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,31 +368,35 @@ do
then
dialog --backtitle "[L41C0] [INSECURE] ZATTOO UNLIMITED BETA > LOGIN" --title "LOGIN" --infobox "Login to webservice..." 3 40

if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L41F0] [INSECURE] ZATTOO UNLIMITED BETA > LOGIN" --title "FATAL ERROR [1]" --infobox "PhantomJS failed to start!" 3 40
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
fi
else
dialog --backtitle "[L41C0] ZATTOO UNLIMITED BETA > LOGIN" --title "LOGIN" --infobox "Login to webservice..." 3 40

if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L41F0] ZATTOO UNLIMITED BETA > LOGIN" --title "FATAL ERROR [1]" --infobox "PhantomJS failed to start!" 3 40
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
Expand Down Expand Up @@ -442,28 +446,32 @@ do

if grep -q "insecure=true" ~/ztvh/user/userfile
then
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L41F0] [INSECURE] ZATTOO UNLIMITED BETA > LOGIN" --title "FATAL ERROR [3]" --infobox "PhantomJS failed to start!" 3 50
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
fi
else
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L41F0] ZATTOO UNLIMITED BETA > LOGIN" --title "FATAL ERROR [3]" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
Expand Down Expand Up @@ -604,29 +612,33 @@ do

if grep -q "insecure=true" ~/ztvh/user/userfile 2> /dev/null
then
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] [INSECURE] ZATTOO UNLIMITED BETA > PROVIDER" --title "[1] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
fi
else
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] ZATTOO UNLIMITED BETA > PROVIDER" --title "[1] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
Expand Down Expand Up @@ -686,29 +698,33 @@ do

if grep -q "insecure=true" ~/ztvh/user/userfile
then
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] [INSECURE] ZATTOO UNLIMITED BETA > PROVIDER" --title "[2] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
fi
else
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs ~/ztvh/work/save_page.js https://$provider/login > cookie_list 2> /dev/null | grep -q "This application failed to start"
if phantomjs ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] ZATTOO UNLIMITED BETA > PROVIDER" --title "[2] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
Expand Down Expand Up @@ -738,31 +754,35 @@ do
then
dialog --backtitle "[L11R0] [INSECURE] ZATTOO UNLIMITED BETA > PROVIDER" --infobox "Checking availability of chosen provider..." 3 50

if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] [INSECURE] ZATTOO UNLIMITED BETA > PROVIDER" --title "[3] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
fi
else
dialog --backtitle "[L11R0] ZATTOO UNLIMITED BETA > PROVIDER" --infobox "Checking availability of chosen provider..." 3 50

if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] ZATTOO UNLIMITED BETA > PROVIDER" --title "[3] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
Expand Down Expand Up @@ -824,29 +844,33 @@ do

if grep -q "insecure=true" ~/ztvh/user/userfile
then
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom --ignore-ssl-errors=true ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] [INSECURE] ZATTOO UNLIMITED BETA > PROVIDER" --title "[4] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
fi
else
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform offscreen ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
if phantomjs ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
export QT_QPA_PLATFORM=phantom
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://www.$provider/login > cookie_list | grep -q "This application failed to start"
if phantomjs -platform phantom ~/ztvh/work/save_page.js https://www.$provider/login 2>&1 >cookie_list | grep -q "This application failed to start"
then
dialog --backtitle "[L11F0] ZATTOO UNLIMITED BETA > PROVIDER" --title "[4] FATAL ERROR" --infobox "PhantomJS failed to start!" 3 50
sleep 2s
clear
echo "ERROR: PhantomJS failed to start - script stopped."
exit 1
fi
fi
Expand Down

0 comments on commit 944c890

Please sign in to comment.