From d1b824e31c7dcfa000ad9da9604d4b26e4c6f249 Mon Sep 17 00:00:00 2001 From: kremlin Date: Fri, 10 Feb 2017 23:06:03 -0600 Subject: [PATCH] install.sh: add overwrite safeguard + overwrite flag --- misc/install.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/misc/install.sh b/misc/install.sh index 859f38e..a36aecb 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -1,4 +1,20 @@ #!/bin/ksh +EUID=`id -g` +if [[ $EUID -ne 0 ]]; then + echo "run me as root!" + exit 1 +fi + +set -e + cd $(dirname "$0")/.. +cp misc/armmake /usr/local/bin/armmake +chmod +x /usr/local/bin/armmake + +if [[ -a /sys/arch/armv7/omap/ammusb.c && $1 != "-f" ]]; then + echo "file already exists! pass -f to overwrite" + exit 1 +fi + cp -R src/* /usr/src -- 2.41.0