mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-11-28 19:25:25 -07:00
Kaj Forney
582f5b5f5c
Former-commit-id: 09eacc3f3f761c2b3454d20356ba085d18bdb722 Former-commit-id: 89d8a1302bd2a72239fbe9ad9820be4ecda76cab
13 lines
372 B
Bash
13 lines
372 B
Bash
check_dir_exists_helper() {
|
|
[ -d "$1" ]
|
|
}
|
|
|
|
# runs the scripts and asserts it has the correct output and exit code
|
|
script_run_helper() {
|
|
local script="$1"
|
|
local expected_output="$2"
|
|
local expected_exit_code="${3:-0}"
|
|
$script 2>&1 |
|
|
grep "$expected_output" >/dev/null 2>&1 && # grep -q flag quits the script early
|
|
[ "${PIPESTATUS[0]}" -eq "$expected_exit_code" ]
|
|
}
|