| 1 | #/bin/sh
|
|---|
| 2 | #Simple Shell script to detect whether or not prerequistes are installed for Debian based systems
|
|---|
| 3 | #Godwin <godwinchan at hotmail point com>
|
|---|
| 4 | #First check for /etc/issue for Debian related strings
|
|---|
| 5 | #then nested if statements
|
|---|
| 6 |
|
|---|
| 7 | if grep -q "Debian\|Ubuntu" /etc/issue
|
|---|
| 8 | then echo "This is a Debian based installation"
|
|---|
| 9 | dpkg --status dkms | grep -q not-installed
|
|---|
| 10 | if [ $? -eq 0 ]; then
|
|---|
| 11 | echo "dkms is not installed!"
|
|---|
| 12 | exit 2
|
|---|
| 13 | dpkg --status build-essential | grep -q not-installed
|
|---|
| 14 | if [ $? -eq 0 ]; then
|
|---|
| 15 | echo "build-essentials is not installed!"
|
|---|
| 16 | dpkg --status linux-headers-generic | grep -q not-installed
|
|---|
| 17 | exit 2
|
|---|
| 18 | if [ $? -eq 0 ]; then
|
|---|
| 19 | echo "linux-headers-generic is not installed!"
|
|---|
| 20 | exit 2
|
|---|
| 21 | fi
|
|---|
| 22 | fi
|
|---|
| 23 | fi
|
|---|
| 24 | fi
|
|---|
| 25 |
|
|---|