default bootstrap password think this is required pw update pseudoterm change pw
25 lines
No EOL
444 B
Bash
Executable file
25 lines
No EOL
444 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Parameters
|
|
ip=$1
|
|
if [ -z "$ip" ]; then
|
|
echo "Usage: $0 <ip>"
|
|
exit 1
|
|
fi
|
|
|
|
# This script is used to bootstrap nixos machine so I can get their ssh keys
|
|
|
|
nixos-rebuild switch \
|
|
--flake ".#$host" \
|
|
--fast \
|
|
--target-host krop@$ip \
|
|
--build-host krop@$ip \
|
|
--use-remote-sudo
|
|
|
|
ret=$?
|
|
if [ $ret -ne 0 ]; then
|
|
echo "Failed to update $ip"
|
|
exit $ret
|
|
fi
|
|
|
|
echo "Successfully updated $ip, rebooting" |