Merge pull request #50 from kennethjiang/master

Use --follow-symlinks option in sed to keep symlink
This commit is contained in:
XECDesign 2017-04-03 10:05:38 +01:00 committed by GitHub
commit bb0d5d44c3

View File

@ -351,9 +351,9 @@ do_wifi_country() {
if [ $? -eq 0 ];then
if [ -e /etc/wpa_supplicant/wpa_supplicant.conf ]; then
if grep -q "^country=" /etc/wpa_supplicant/wpa_supplicant.conf ; then
sed -i "s/^country=.*/country=$COUNTRY/g" /etc/wpa_supplicant/wpa_supplicant.conf
sed -i --follow-symlinks "s/^country=.*/country=$COUNTRY/g" /etc/wpa_supplicant/wpa_supplicant.conf
else
sed -i "1i country=$COUNTRY" /etc/wpa_supplicant/wpa_supplicant.conf
sed -i --follow-symlinks "1i country=$COUNTRY" /etc/wpa_supplicant/wpa_supplicant.conf
fi
else
echo "country=$COUNTRY" > /etc/wpa_supplicant/wpa_supplicant.conf