Skip to content

Instantly share code, notes, and snippets.

Created October 20, 2012 12:41
Show Gist options
  • Save anonymous/3923175 to your computer and use it in GitHub Desktop.
Save anonymous/3923175 to your computer and use it in GitHub Desktop.
./rjsupplicant.sh
#! /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