updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / gmabooster / gmabooster.sh
blob1b0d8568df94cbcfbd2ae41b82b3a017e2fb9509
1 #!/bin/bash
3 # Contributor: Chris Down <cdown.uk@gmail.com>
5 # Wrapper for gmabooster to prompt that it should be run as root
7 # We don't want to simply block root or check for the existence of su/sudo,
8 # as the user might be running in a fakeroot environment, etc...
9 # (and even if we aren't root, let's assume the user knows what they're doing)
11 if [[ "${EUID}" -eq 0 ]]; then
12 /opt/GMABooster/GMABooster "$@"
13 # Store it in a variable so we can exit with the same return code
14 gbexit="$?"
15 else
16 echo "GMABooster should be run as root to function properly."
18 while true; do
19 read -p "Do you wish to continue anyway? (y/n): " DOCONT
20 case "${DOCONT}" in
21 y|Y)
22 /opt/GMABooster/GMABooster "$@"
23 exit "$?"
25 n|N) exit "126" ;;
26 *) echo "Please enter y or n." ;;
27 esac
28 done
31 # Exit with the same return code as gmabooster
32 # (We shouldn't ever get down to here... but just in case)
33 exit "${gbexit-127}"