feat(testbed/cron): support nixos #69

Merged
DictXiong merged 3 commits from nixos into main 2024-05-29 22:44:41 +08:00
Showing only changes of commit 937bf9e000 - Show all commits

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -ex
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
@ -46,7 +46,10 @@ update_key() {
}
main() {
cp "$THIS_DIR/nasp" "/etc/sudoers.d/nasp"
if [ -f /etc/os-release ]; then
. /etc/os-release
test "$ID" = "nixos" || cp "$THIS_DIR/nasp" "/etc/sudoers.d/nasp"
fi
for file in "$THIS_DIR"/../authorized_keys/* ; do
if [[ ! -d "$file" ]]; then
continue