summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmwarebinary/files/uname.sh
blob: 71d6802f728f1c71e4616f55a241a7b6d2201422 (plain) (blame)
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
#!/bin/sh

#TODO: -m returns i686... we dont know it, we asume it!

# get newest kernel. We asume it is used
kfile=$(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$"|sort|tail -n 1)
kversion=$(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)

fullversion=$(strings ${kfile}|grep -e "${kversion}")

case $1 in
	-r)
		echo "${kversion}"
		;;
	-s)
		echo "Linux"
		;;
	-v)
		echo "${fullversion}"|sed 's/.*) //'
		;;
	-m)
		echo "i686"
		;;
	-rs)
		echo "Linux ${kversion}"
		;;
esac