Created
October 20, 2012 12:41
-
-
Save anonymous/3923175 to your computer and use it in GitHub Desktop.
./rjsupplicant.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
curDir=$(cd "$(dirname "$0")"; pwd); | |
arg=""; | |
until [ $# -eq 0 ] | |
do | |
opt=$1; | |
if [ "${opt/ /}" != "$opt" ]; then | |
arg="$arg \"$opt\""; | |
else | |
arg="$arg $opt"; | |
fi | |
shift | |
done | |
function is64BIT() | |
{ | |
os=$(getconf LONG_BIT); | |
if [ $os != "64" ]; then | |
return 0; | |
fi | |
return 1; | |
} | |
function main() | |
{ | |
is64BIT; | |
if [ $? != "1" ]; then | |
chmod +x $curDir/x86/rjsupplicant 2>&-; | |
cd $curDir/x86/ | |
sh -c "$curDir/x86/rjsupplicant $arg"; | |
else | |
chmod +x $curDir/x64/rjsupplicant 2>&-; | |
cd $curDir/x64/ | |
sh -c "$curDir/x64/rjsupplicant $arg"; | |
fi | |
} | |
main; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment