I\'m creating a Bash installer script which compiles and installs some libraries for both OSX and Linux. Because some commands in my script (\"make install\", \"apt-get install\
function checkSudo() {
if ((EUID != 0)); then
echo "Granting root privileges for script ( $SCRIPT_NAME )"
if [[ -t 1 ]]; then
sudo "$0" "$@"
else
exec 1>output_file
gksu "$0" "$@"
fi
exit
fi
}