File: setup.xterminal

package info (click to toggle)
lessdisks 0.5.3cvs.20040906-16
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,480 kB
  • ctags: 271
  • sloc: sh: 3,058; makefile: 92
file content (59 lines) | stat: -rw-r--r-- 1,612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#$lessdisks_path/usr/share/lessdisks/terminal-types/setup.xterminal

# this is called by lessdisks-setup when creating a new
# terminal. 

# it handles xterminal-specific configuration, 
# such as getting the XF86Config file and putting the
# appropriate "xserver=" into
# /etc/lessdisks/terminals/$hostname

# copyright 2004 vagrant@freegeek.org, distributed under the terms of the
# GNU General Public License version 2 or any later version.

# assume this script has access to the easydialog functions

if [ ! -d "$tempdir" ]; then
  echo "WARNING: no tempdir found..."
fi

booleanBox "Xterminal Configuration" "Configure this machine to be used as an X terminal?"

if [ "0" != "$?" ]
then
  echo "not configuring X"
else
  if [ -z "$xserver" ]; then
    # TODO better manual selection of X server...
    inputBox "lessdisks terminal configuration" \
      "no X server was defined. this may be a problem. did you configure the X server? please enter the name of your X server here:" \
      "XFree86"
    xserver="$REPLY"
  fi

  if [ -n "$x_config_file" ]; then
    # get XF86Config
    wget http://$ipaddress:8080/$x_config_file -O /$tempdir/XF86Config
  fi

  cd /etc/lessdisks/terminals

  if [ -r XF86Config.$hostname ]; then
    mv XF86Config.$hostname XF86Config.$hostname.old
  fi

  if [ -s "/$tempdir/XF86Config" ]; then
    cp /$tempdir/XF86Config XF86Config.$hostname
  else
    echo "WARNING: no XF86Config file found!"
    sleep 2
  fi

  cd /etc/lessdisks/terminals

  egrep -v "^xserver=" $hostname > $hostname.new

  echo "xserver=$xserver" >> $hostname.new

  mv $hostname.new $hostname
fi