Initial commit

This commit is contained in:
2021-10-16 15:06:07 -04:00
parent 9a839d6530
commit b2d495dadc
13 changed files with 663 additions and 0 deletions

16
functions Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Common functions for the lab scripts
# Copyright 2021 Bryan C. Roessler
ask_ok() {
read -r -p "$* [y/N]" response
response=${response,,}
[[ ! "$response" =~ ^(yes|y)$ ]] && return 1
return 0
}
is_root() {
user=$(whoami)
[[ $user != "root" ]] && echo "Script must be run with sudo rights!" && exit 1
}