server-scripts/nixos-safe-rebuild

12 lines
215 B
Plaintext
Raw Permalink Normal View History

2018-09-13 07:43:21 +00:00
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "Must be root!" >&2
exit 1
fi
nixos-rebuild switch
echo "Press Ctrl-C to apply changes permanently (Rollback in 10s)"
sleep 10
nixos-rebuild switch --rollback