1
Fork 0

good night

This commit is contained in:
caem 2025-01-12 03:44:23 +01:00
parent 4830f943b4
commit fdd9ec1568
Signed by: caem
GPG key ID: 69A830D03203405F

View file

@ -17,6 +17,7 @@ args_ensure_extra_arg() {
args_ensure_is_set() {
if [ -z "$2" ]; then
>&2 echo "Argument '$1' is required to be set. Please consult the README or run again with --help."
exit 1
fi
}
@ -51,7 +52,7 @@ args() {
"-o" | "--host")
args_ensure_extra_arg "$@"
if [ ! -f "./hosts/$2" ]; then
if [ ! -d "./hosts/$2" ]; then
>&2 echo "Invalid hostname '$2'. Make sure it exists in ./hosts"
exit 1
fi
@ -71,8 +72,19 @@ args() {
args_ensure_is_set "--host" "$DOTNIX_HOSTNAME"
}
update_managed_values() {
echo "piss"
}
main () {
args "$@"
update_managed_values
if [ "$(id -u)" != "0" ]; then
>&2 echo "The installation script must be run as root to work."
exit 1
fi
}
set -e