wrtnix/openwrt-rebuild.sh

15 lines
500 B
Bash
Raw Normal View History

2024-07-29 22:48:13 -06:00
#!/usr/bin/env bash
mkdir -p /etc/nix
generation="$(basename "$(readlink /etc/nix-current)" || echo 0)"
((generation++))
echo "[nix-openwrt] creating new generation in /etc/nix/$generation"
mkdir -p "/etc/nix/$generation"
rm "/etc/nix-current"
ln -s "/etc/nix/$generation" "/etc/nix-current"
ln -s "/etc/nix-current/etc/config/wireless" "/etc/config/wireless"
reload_config
# mkdir -p "/etc/nix-current/config"
# rm /etc/config/wireless
# ln -s /etc/nix-current/config/wireless /etc/config/wireless