File: config

package info (click to toggle)
xvmount 3.7-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 152 kB
  • ctags: 68
  • sloc: ansic: 448; sh: 255; makefile: 90
file content (30 lines) | stat: -rw-r--r-- 786 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
#!/bin/sh
# The script has to retrieve all information that is needed
# to guarantee that a valid xvmount configuration file 
# is installed or generated.

# Source debconf library.
. /usr/share/debconf/confmodule

db_title 'XVMount Setup'

SYSTEMCONF='/etc/xvmounttab'

# Existence of old configuration file
if [ -r "$SYSTEMCONF" ]
then
  # Detect old format configuration file
  if egrep -q -e '^[[:space:]]*([^[:space:]#]+[[:space:]]+){4}[^[:space:]#]+' ${SYSTEMCONF}
  then
     db_input medium xvmount/convert_old_config || true
     db_go
  else
  # Check for new format
    if ! egrep -q -e '^[[:space:]]*[^[:space:]#]+[[:space:]]+[^[:space:]#]+' ${SYSTEMCONF}
    then
      # format not recognized 
      db_input medium xvmount/wrong_format || true
      db_go
    fi
  fi
fi