Symlink notifyd.py to osd_server.py for backward compatibility
[grml-scripts.git] / usr_bin / grml-info
1 #!/bin/zsh
2 # Filename:      grml-info
3 # Purpose:       start browser with documentation for grml
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 ################################################################################
8
9 local PAGE='/usr/share/doc/grml-docs/startpage.html'
10
11 . /etc/grml/script-functions
12
13 # do we have X?
14 if [ -n "$DISPLAY" ]; then
15    if check4progs dillo ; then
16       dillo $PAGE
17    elif check4progs xlinks2 ; then
18       xlinks2 -mode 640x480 $PAGE
19    elif check4progs firefox ; then
20       firefox $PAGE
21    elif check4progs x-www-browser ; then
22       x-www-browser $PAGE
23    elif check4progs Xdialog ; then
24       Xdialog --msgbox "Sorry, no usable X browser found." 0 0
25    fi
26 else # no X:
27    # do we have a real console?
28    if [[ $(tty) == /dev/tty* ]] ; then
29       # do we have framebuffer support?
30       if [ -c /dev/fb0 ] ; then
31          if check4progs links2 ; then
32             links2 -driver fb $PAGE
33          elif check4progs w3m ; then
34             w3m $PAGE
35          elif check4progs links ; then
36             links $PAGE
37          else
38             echo "Sorry, neither links2 nor w3m nor links available. Exiting.">&2
39             exit 20
40          fi
41       else # no, we don't have framebuffer
42          if check4progs w3m ; then
43             w3m $PAGE
44          elif check4progs links ; then
45             links $PAGE
46          elif check4progs links2 ; then
47             links2 $PAGE
48          else
49             echo "Sorry, neither w3m nor links nor links2 available. Exiting.">&2
50             exit 30
51          fi
52       fi
53    else # no, probably we are running inside GNU screen
54       if check4progs w3m ; then
55          w3m $PAGE
56       elif check4progs links2 ; then
57          links2 $PAGE
58       elif check4progs links ; then
59          links $PAGE
60       else
61          echo "Sorry, neither w3m nor links2 nor links available. Exiting.">&2
62          exit 40
63       fi
64    fi
65 fi
66
67 ## END OF FILE #################################################################