You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
441 B

#!/usr/bin/env bash
# CONSTANTS
# FUNCTIONS
function halt_on_error {
>&2 echo "ERROR: $1"
exit ${2:-1}
}
function assert_root {
[ "$(id -u)" -ne 0 ] && halt_on_error 'root privilege required!'
}
function assert_proxmox {
grep -q ^ID=debian /etc/os-release || halt_on_error 'distro debian required!' 2
command -v pct >/dev/null || halt_on_error 'command `pct` not found!' 3
}
# MAIN
set Eue
assert_root
assert_proxmox
echo OK