blob: ae127948c5e395fe1f14c1463df237991ea3a3f8 [file] [log] [blame]
developer90379572024-05-29 17:23:20 +08001#!/bin/sh
2##########################################################################
3# If not stated otherwise in this file or this component's Licenses.txt
4# file the following copyright and licenses apply:
5#
6# Copyright 2023 RDK Management
7#
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19##########################################################################
20
21WIFI_DIR="/opt/secure/wifi"
22WPA_SUP_CONF="${WIFI_DIR}/wpa_supplicant.conf"
23
24if [ ! -d "${WIFI_DIR}" ]; then
25 echo "Creating '${WIFI_DIR}'..."
26 mkdir -p ${WIFI_DIR}
27fi
28
29if [ ! -f "${WPA_SUP_CONF}" ]; then
30 echo "'${WPA_SUP_CONF}' not found; creating with deafult values..."
31 echo "ctrl_interface=/var/run/wpa_supplicant" >> ${WPA_SUP_CONF}
32 echo "ctrl_interface_group=0" >> ${WPA_SUP_CONF}
33 echo "update_config=1" >> ${WPA_SUP_CONF}
34 sync
35fi