summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/lib/sh-test-lib6
1 files changed, 6 insertions, 0 deletions
diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib
index bdc74e8..1429db6 100755
--- a/automated/lib/sh-test-lib
+++ b/automated/lib/sh-test-lib
@@ -186,6 +186,8 @@ install_deps() {
if [ "${skip_install}" = "True" ] || [ "${skip_install}" = "true" ]; then
info_msg "install_deps skipped"
else
+ ! check_root && \
+ error_msg "About to install packages, please run this script as root."
info_msg "Installing ${pkgs}"
dist_name
case "${dist}" in
@@ -281,6 +283,8 @@ add_key() {
[ "$#" -ne 1 ] && error_msg "Usage: add_key url"
url="$1"
+ ! check_root && \
+ error_msg "About to use apt-key, please run this script as root."
dist_name
case "${dist}" in
debian|ubuntu) wget -O - "${url}" | apt-key add - ;;
@@ -293,6 +297,8 @@ add_repo() {
[ "$#" -lt 1 ] && error_msg "Usage: add_repo <url> [backports]"
url="$1"
+ ! check_root && \
+ error_msg "About to add a repo, please run this script as root."
dist_name
case "${dist}" in
# Detect Debian/Ubuntu codename and add repo automatically. The same url