Skip to content

Commit

Permalink
restore applying file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Mar 11, 2024
1 parent 15f5f61 commit a7460ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/helperscripts/inc.networkHelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ WPA_CONF="/etc/wpa_supplicant/wpa_supplicant.conf"
clear_wireless_networks() {
if [[ $(is_dhcpcd_enabled) == true ]]; then
sudo sed -i -e '/^[[:space:]]*$/d' -e '/^network={/,/^}/d' $WPA_CONF
sudo chown root:netdev "${WPA_CONF}"
sudo chmod 664 "${WPA_CONF}"
fi

if [[ $(is_NetworkManager_enabled) == true ]]; then
Expand All @@ -68,6 +70,8 @@ add_wireless_network() {
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"
sudo chown root:netdev "${WPA_CONF}"
sudo chmod 664 "${WPA_CONF}"
fi
fi
fi
Expand Down

0 comments on commit a7460ef

Please sign in to comment.