Skip to content

Instantly share code, notes, and snippets.

@Ch00k
Created August 30, 2013 15:41
Show Gist options
  • Save Ch00k/6391153 to your computer and use it in GitHub Desktop.
Save Ch00k/6391153 to your computer and use it in GitHub Desktop.
if
__system_and_version_is SunOS 5.10
then
if __rvm_which sudo >/dev/null 2>&1
then sudo_path=""
else sudo_path=/opt/csw/bin/
fi
else
sudo_path=""
fi
if
__rvm_which ${sudo_path}sudo >/dev/null 2>&1
then
command_to_run=( ${sudo_path}sudo -p "%p password required for '${command_to_run[*]}': " "${command_to_run[@]}" )
else
rvm_requiremnts_fail error "Running '$*' would require sudo, but 'sudo' is not found in PATH!"
return 1
fi
if
__system_and_version_is SunOS 5.10
then
__rvm_which sudo >/dev/null 2>&1 || sudo_path=/opt/csw/bin/
fi
if
__rvm_which ${sudo_path}sudo >/dev/null 2>&1
then
command_to_run=( ${sudo_path}sudo -p "%p password required for '${command_to_run[*]}': " "${command_to_run[@]}" )
else
rvm_requiremnts_fail error "Running '$*' would require sudo, but 'sudo' is not found in PATH!"
return 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment