From e4dc2a45089edbd3d6af4064fd04ead8d6b1cef5 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:40:11 +0200 Subject: [PATCH] fix: command for special char handling --- scripts/helperscripts/inc.networkHelper.sh | 2 +- scripts/helperscripts/setup_autohotspot.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/helperscripts/inc.networkHelper.sh b/scripts/helperscripts/inc.networkHelper.sh index ff0df181e..f96a9138d 100644 --- a/scripts/helperscripts/inc.networkHelper.sh +++ b/scripts/helperscripts/inc.networkHelper.sh @@ -74,7 +74,7 @@ add_wireless_network() { local wpa_network_with_dummy_psk=$(wpa_passphrase "$ssid" "dummypsk") if echo "$wpa_network_with_dummy_psk" | grep -qF 'network='; then local wpa_network=$(echo "$wpa_network_with_dummy_psk" | sed -e '/#psk/d' -e "s/psk=.*$/psk=${pass}/" -e "/^}/i\\\tpriority=${prio}" ) - sudo bash -c "echo '${wpa_network}' >> $WPA_CONF" + echo "${wpa_network}" | sudo tee -a "$WPA_CONF" > /dev/null fi fi fi diff --git a/scripts/helperscripts/setup_autohotspot.sh b/scripts/helperscripts/setup_autohotspot.sh index f74ed88d9..61d0e2297 100644 --- a/scripts/helperscripts/setup_autohotspot.sh +++ b/scripts/helperscripts/setup_autohotspot.sh @@ -125,7 +125,7 @@ _install_autohotspot_dhcpcd() { fi if [[ ! $(grep -w "${dhcpcd_conf_nohook_wpa_supplicant}" ${dhcpcd_conf}) ]]; then - sudo bash -c "echo ${dhcpcd_conf_nohook_wpa_supplicant} >> ${dhcpcd_conf}" + echo "${dhcpcd_conf_nohook_wpa_supplicant}" | sudo tee -a "${dhcpcd_conf}" > /dev/null fi # create service to trigger hotspot