File: preinst

package info (click to toggle)
raidtools 0.42-21
  • links: PTS
  • area: main
  • in suites: potato
  • size: 400 kB
  • ctags: 128
  • sloc: ansic: 2,056; makefile: 137; sh: 85
file content (36 lines) | stat: -rw-r--r-- 702 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
#! /bin/sh

set -e

usage()
{
    echo "You're using a stable kernel version older than 2.0.35, or unstable"
    echo "kernel older than 2.1.63.  This package is not designed to work with it."
    echo "You should install the mdutils package instead or upgrade your kernel."
    echo "If you have a patched kernel touch /etc/raid/raid5.conf and this package"
    echo "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