Verified Commit 357141aa authored by Stephan's avatar Stephan Committed by Sven enniK
Browse files

- fix "nvram get"

  when value has an "=" "nvram get" had returned an emtpy value.
  e.g.: wireguard_secret=APZiy5Wp3G9XzHOLbREC4T3e9CrUXjwDj02QzyPsIns==
- convert wireguard_secret (if present)
parent 270eb5a5
Loading
Loading
Loading
Loading
+3 −1
Changes for salt/freifunk/base/uci/usr/local/bin/nvram-migration.sh: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
#!/bin/sh

nvram_get() { sed -n "/^$1=/{s#^.*=##;p}" /etc/nvram.conf | head -1 ; }
nvram_get() { sed -n "/^$1=/{s#^[^=]*=##;p}" /etc/nvram.conf | head -1 ; }

if [ -f /etc/nvram.conf ]; then

@@ -25,6 +25,8 @@ if [ -f /etc/nvram.conf ]; then
	uci set ffdd.sys.fastd_public="$(nvram_get fastd_public)"
	uci set ffdd.sys.fastd_restrict="$(nvram_get fastd_restrict)"

    uci set ffdd.sys.wireguard_secret="$(nvram_get wireguard_secret)"
    
	uci set ffdd.sys.ssh_pwauth="$(nvram_get ssh_pwauth)"

	uci set ffdd.sys.ifname="$(nvram_get ifname)"