-1
I have a system on top of a Raspberry that needs to work online. A Raspberry that opens directly a page on Chromium. What I’m trying to do is this scprit I did.
#!/bin/bash
wget -q --spider https://v4.permitt.com.br
if [[ $? -eq 0 ]]; then
if [ -e /home/condoseg/offline ]; then
sudo rm -rf /home/condoseg/offline
killall chromium-browser-v7
DISPLAY=:0 chromium-browser --args --incognito --disable-web-security --kiosk --allow-running-insecure-content --user-data-dir="/home/condoseg" --use-fake-ui-for-media-stream https://v4.permitt.com.br &
fi
else
if [ ! -e /home/condoseg/offline ]; then
killall chromium-browser
DISPLAY=:0 chromium-browser --args --incognito --disable-web-security --kiosk --allow-running-insecure-content --use-fake-ui-for-media-stream --user-data-dir="/home/condoseg" http://localhost/novoindex.html &
touch /home/condoseg/offline
fi
fi
It identifies when the computer has internet access, and when it is not, redirects to a page on the localhost. And vice versa. I’ve already managed to do so when it’s offline it redirects to the page I created inside the localhost, but when the computer has internet again, I’d like it to go back to the system home page.