summaryrefslogtreecommitdiffstats
path: root/about/about-mageia
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-03-13 19:19:36 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-03-13 19:19:44 +0100
commite63429937b6cfa71709e3c39e0a340e448a0b583 (patch)
treebf4a01fc508c23c6bc8d864e3411a2c967af3f70 /about/about-mageia
parent65961bdaa38cba49a4469cbbaa233749161cffe4 (diff)
downloadindexhtml-e63429937b6cfa71709e3c39e0a340e448a0b583.tar
indexhtml-e63429937b6cfa71709e3c39e0a340e448a0b583.tar.gz
indexhtml-e63429937b6cfa71709e3c39e0a340e448a0b583.tar.bz2
indexhtml-e63429937b6cfa71709e3c39e0a340e448a0b583.tar.xz
indexhtml-e63429937b6cfa71709e3c39e0a340e448a0b583.zip
Fix about-mageia looking for non-existing directory (mga#12131)
This fix had been provided as an alternative source in the SRPM and never committed to git. (That's bad!)
Diffstat (limited to 'about/about-mageia')
-rwxr-xr-xabout/about-mageia37
1 files changed, 18 insertions, 19 deletions
diff --git a/about/about-mageia b/about/about-mageia
index 6f981c0..f37d256 100755
--- a/about/about-mageia
+++ b/about/about-mageia
@@ -1,22 +1,21 @@
#!/bin/sh
-if [ "x$GNOME_DESKTOP_SESSION_ID" != "x" -a -x /usr/bin/yelp ]; then
- www_browser="/usr/bin/yelp"
-else
- www_browser="xdg-open"
-fi
-
-for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
- file="/usr/share/mdk/about/index-$lang.html"
- if [ -f "$file" ]; then
- $www_browser $file
- exit 0
- fi
-done
+WGET="$(which wget)"
-if [ -f /usr/share/mdk/about/index.html ]; then
- $www_browser /usr/share/mdk/about/index.html
- exit 0
+$WGET -q --tries=20 --timeout=10 http://www.google.com -O /tmp/google.idx &> /dev/null
+if [ ! -s /tmp/google.idx ]; then
+ echo "ERROR: No internet connection detected.
+In order to display About Mageia page you should have an working connection."
+ exit 1
+else
+ for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
+ $WGET -q --tries=20 --timeout=10 http://www.mageia.org/$lang/about -O /tmp/mageiaorg.idx &> /dev/null
+ if [ ! -s /tmp/mageiaorg.idx ]; then
+ echo "WARNING: There is no localized Mageia About web page;
+displaying English web page"
+ xdg-open "http://www.mageia.org/en/about"
+ else
+ xdg-open "http://www.mageia.org/$lang/about"
+ exit 0
+ fi
+ done
fi
-
-echo "file not found for about Mageia"
-exit 1