xref: /freebsd/contrib/wpa/wpa_supplicant/wpa_supplicant_conf.sh (revision 0bfd163f522701b486e066fa2e56624c02f5081a)
1*f05cddf9SRui Paulo#!/bin/bash
2*f05cddf9SRui Paulo#
3*f05cddf9SRui Paulo# Copyright (C) 2010 The Android Open Source Project
4*f05cddf9SRui Paulo#
5*f05cddf9SRui Paulo# This software may be distributed under the terms of the BSD license.
6*f05cddf9SRui Paulo# See README for more details.
7*f05cddf9SRui Paulo#
8*f05cddf9SRui Paulo
9*f05cddf9SRui Paulo# Generate a wpa_supplicant.conf from the template.
10*f05cddf9SRui Paulo# $1: the template file name
11*f05cddf9SRui Pauloif [ -n "$WIFI_DRIVER_SOCKET_IFACE" ]
12*f05cddf9SRui Paulothen
13*f05cddf9SRui Paulo  sed -e 's/#.*$//' -e 's/[ \t]*$//' -e '/^$/d' < $1 | sed -e "s/wlan0/$WIFI_DRIVER_SOCKET_IFACE/"
14*f05cddf9SRui Pauloelse
15*f05cddf9SRui Paulo  sed -e 's/#.*$//' -e 's/[ \t]*$//' -e '/^$/d' < $1
16*f05cddf9SRui Paulofi
17