File: preinst

package info (click to toggle)
raidtools 0.42-16
  • links: PTS
  • area: main
  • in suites: slink
  • size: 392 kB
  • ctags: 128
  • sloc: ansic: 2,056; makefile: 134; sh: 107
file content (35 lines) | stat: -rw-r--r-- 669 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
#! /bin/sh

set -e

usage()
{
    echo "You're using a kernel version older than 2.0.35 and older than 2.1.63."
    echo "This package is not designed to work with it.  You should install the"
    echo "mdutils package instead or upgrade your kernel.  If you have a patched"
    echo "kernel touch /etc/raid/raid5.conf and this package will smoothly install."
    echo -n "Press Enter to continue... "; read ans
    exit 1
}

if [ -f /etc/raid/raid5.conf ]
then
    exit 0
fi

kver=`uname -r`

case $kver in
2.0.*)
	if `dpkg --compare-versions $kver lt 2.0.35`
	then
	    usage
	fi
	;;
2.1.*)
	if `dpkg --compare-versions $kver lt 2.1.63`
	then
	    usage
	fi
	;;
esac