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 e75179eb57 - Show all commits

View File

@ -22,7 +22,7 @@ touch_user() {
su - $1 -c "true" su - $1 -c "true"
mkdir -p /home2/$1 mkdir -p /home2/$1
chown $1: /home2/$1 chown $1:nasp /home2/$1
} }
update_key() { update_key() {
@ -37,12 +37,12 @@ update_key() {
if [[ ! -d "$dest_dir" ]]; then if [[ ! -d "$dest_dir" ]]; then
mkdir -p "$dest_dir" mkdir -p "$dest_dir"
chown $1:$1 "$dest_dir" chown $1:nasp "$dest_dir"
chmod 700 "$dest_dir" chmod 700 "$dest_dir"
fi fi
cat "$tmp_path" > "$dest_path" cat "$tmp_path" > "$dest_path"
rm "$tmp_path" rm "$tmp_path"
chown $1:$1 "$dest_path" chown $1:nasp "$dest_path"
chmod 600 "$dest_path" chmod 600 "$dest_path"
} }