diff options
author | John Klug <john.klug@multitech.com> | 2020-08-18 10:13:26 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-11-12 09:25:54 -0600 |
commit | a15c425dda7807f17b5526160f6fb164c05da0e1 (patch) | |
tree | 79946c2609960e10a0b145beda3b8f62ec00134e /recipes-connectivity/hostapd/files/setchan | |
parent | 46a563b98097d110936ce40dceaa180f61205415 (diff) | |
download | meta-mlinux-a15c425dda7807f17b5526160f6fb164c05da0e1.tar.gz meta-mlinux-a15c425dda7807f17b5526160f6fb164c05da0e1.tar.bz2 meta-mlinux-a15c425dda7807f17b5526160f6fb164c05da0e1.zip |
Add hostapd-extra package for setting channel and SSID
Diffstat (limited to 'recipes-connectivity/hostapd/files/setchan')
-rwxr-xr-x | recipes-connectivity/hostapd/files/setchan | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/recipes-connectivity/hostapd/files/setchan b/recipes-connectivity/hostapd/files/setchan new file mode 100755 index 0000000..ceae0cf --- /dev/null +++ b/recipes-connectivity/hostapd/files/setchan @@ -0,0 +1,24 @@ +#!/bin/bash +echo 'Old Channel' +egrep '^channel=|^hw_mode=' /var/config/hostapd.conf +CHAN=$1 +if ! [[ $CHAN =~ ^[0-9]+$ ]] ; then + echo channel must be an integer +fi +if ((CHAN < 15)) ; then + HW='g' +else + HW='a' +fi + +sed -i "s/^channel=.*/channel=${CHAN}/" /var/config/hostapd.conf +sed -i "s/^hw_mode=.*/hw_mode=${HW}/" /var/config/hostapd.conf + +/etc/init.d/bt-pan stop +/etc/init.d/bluetooth stop +/etc/init.d/hostapd stop +/etc/init.d/rs9113 stop +/etc/init.d/rs9113 start +/etc/init.d/bluetooth start +/etc/init.d/bt-pan start +/etc/init.d/hostapd start |