diff --git a/x230/build.sh b/x230/build.sh index 1c3b015..66fcd9c 100755 --- a/x230/build.sh +++ b/x230/build.sh @@ -1,3 +1,7 @@ #!/bin/bash +. skulls_common.sh + +warn_not_root + cd .. ./build.sh --clean-slate --commit $(ls -1 x230/config-* | cut -c 13-22) x230 diff --git a/x230/skulls_common.sh b/x230/skulls_common.sh index af420b4..1f167f1 100755 --- a/x230/skulls_common.sh +++ b/x230/skulls_common.sh @@ -43,3 +43,8 @@ check_battery() { fi } +warn_not_root() { + if [[ $EUID -eq 0 ]]; then + echo -e "${RED}This script should not be run as root!${NC}" + fi +} diff --git a/x230/upgrade.sh b/x230/upgrade.sh index b29f961..74cf9c1 100755 --- a/x230/upgrade.sh +++ b/x230/upgrade.sh @@ -7,6 +7,8 @@ NC='\033[0m' set -e +. skulls_common.sh + usage() { echo "Skulls for the X230" @@ -43,6 +45,8 @@ do shift done +warn_not_root + command -v curl >/dev/null 2>&1 || { echo -e >&2 "${RED}Please install curl.${NC}"; exit 1; } CURRENT_VERSION=$(head -2 NEWS | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")