Author: Paul_R
Date: 2008-09-10 09:12:13 +0200 (Wed, 10 Sep 2008)
New Revision: 1836

Modified:
   software_suite_v2/tuxware/installers/unix/trunk/Installer.sh
Log:
* Improved the way to find the distro


Modified: software_suite_v2/tuxware/installers/unix/trunk/Installer.sh
===================================================================
--- software_suite_v2/tuxware/installers/unix/trunk/Installer.sh        
2008-09-10 06:59:45 UTC (rev 1835)
+++ software_suite_v2/tuxware/installers/unix/trunk/Installer.sh        
2008-09-10 07:12:13 UTC (rev 1836)
@@ -186,41 +186,18 @@
 # Find the system
 ##
 findSystem () {
-    SYSTEM=unknow
-    cat /etc/issue |grep Ubuntu >/dev/null
-    if  [ $? == 0 ]
-    then
-        echo "Ubuntu"
-        SYSTEM=ubuntu
-    fi
-    
-    cat /etc/issue |grep SUSE >/dev/null
-    if [ $? == 0 ]
-    then
-        echo "OpenSUSE"
-        SYSTEM=suse
-    fi
-    
-    cat /etc/issue |grep Fedora >/dev/null
-    if [ $? == 0 ]
-    then
-        echo "Fedora"
-        SYSTEM=fedora
-    fi
-
-    cat /etc/issue |grep Mint >/dev/null
-    if [ $? == 0 ]
-    then
-        echo "Mint"
-        SYSTEM=mint
-    fi
-    
-    cat /etc/issue |grep PCLinuxOS >/dev/null
-    if [ $? == 0 ]
-    then
-        echo "PC Linux OS"
-        SYSTEM=pclos
-    fi
+    WORD=(Ubuntu SUSE Fedora Mint PCLinuxOS)
+    SYS=(ubuntu suse fedora mint pclos)
+    declare -i j=0
+    for i in [EMAIL PROTECTED]
+    do
+        cat /etc/issue |grep $i >/dev/null
+        if [ $? == 0 ]; then
+            SYSTEM=${SYS[$j]}
+            break
+        fi
+        j=$j+1
+    done
 }
 
 ##


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to