From 2840e21a14b8341f229622c7a4763d1ba358a2d9 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Fri, 25 Mar 2011 11:08:57 +0300 Subject: [PATCH] Fix videodrv param num, add check xorg.conf existsing. --- data/calculate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/data/calculate b/data/calculate index 0f9bcca..0962226 100755 --- a/data/calculate +++ b/data/calculate @@ -8,7 +8,11 @@ depend() { xorg_video_driver() { - cat /etc/X11/xorg.conf | grep Driver | cut -d\" -f2 + local xorgFile="/etc/X11/xorg.conf" + if [[ -f $xorgFile ]] + then + cat /etc/X11/xorg.conf | grep Driver | cut -d\" -f2 + fi } cmdline_video_driver() @@ -19,7 +23,7 @@ cmdline_video_driver() case $x in calculate\=*) local value=`echo "$x" | cut -d\= -f2-` - local videodrv=`echo "$value" | cut -d, -f4` + local videodrv=`echo "$value" | cut -d, -f5` if [[ -n $videodrv ]] then echo "$videodrv"