Browse Source

ensure we are on mac os before running install/uninstall script

master
Jonathan Cobb 4 years ago
parent
commit
0f17e7fe1f
2 changed files with 20 additions and 0 deletions
  1. +10
    -0
      macos/install.sh
  2. +10
    -0
      macos/uninstall.sh

+ 10
- 0
macos/install.sh View File

@@ -15,6 +15,16 @@ function die {
exit 1
}

PLATFORM="$(uname -a | awk '{print $1}')"
case "${PLATFORM}" in
Darwin*)
# OK
;;
*)
die "This is the Mac OS X install.sh script. Cannot run on ${PLATFORM}"
;;
esac

if [[ $(whoami) != "root" ]] ; then
echo "Started as $(whoami), running sudo"
sudo "${0}"


+ 10
- 0
macos/uninstall.sh View File

@@ -14,6 +14,16 @@ function die {
exit 1
}

PLATFORM="$(uname -a | awk '{print $1}')"
case "${PLATFORM}" in
Darwin*)
# OK
;;
*)
die "This is the Mac OS X install.sh script. Cannot run on ${PLATFORM}"
;;
esac

if [[ $(whoami) != "root" ]] ; then
echo "Started as $(whoami), running sudo"
sudo "${0}"


Loading…
Cancel
Save