From 28809e0ef94444320ee839aed2e81e5dec2832ad Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 10 Nov 2022 17:15:00 +0100 Subject: [PATCH] check target OS --- nixos-remote | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos-remote b/nixos-remote index 0ce10ed..3e8b517 100755 --- a/nixos-remote +++ b/nixos-remote @@ -77,6 +77,11 @@ if [ ${is_kexec-n} != "y" ]; then # TODO we probably need an architecture detection here ssh_ << SSH set -efux +os=\$(uname) +if [[ "\$os" != "Linux" ]]; then + echo "This script requires Linux as the operating system, but got \${os}" >&2 + exit 1 +fi fetch(){ if command -v curl >/dev/null 2>&1; then curl --fail -Ss -L "\$1"