#!/bin/sh
# Copyright (c) 2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.


# HOSTAPD script to detach the Hostapd daemon from Global HostAPD

set -e

echo "qcmap: hostapd: printing debug logs for hostapd on interface" $1

if [ ${type} = "detach" ]; then
    /usr/sbin/wpa_cli -g ${global_ctrl_iface} raw REMOVE ${iface}
else
    if [ ${type} = "attach" ]; then
        /usr/sbin/wpa_cli -g ${global_ctrl_iface} raw ADD bss_config=${iface_name}:${bss_config_path}
    fi
fi

exit 0
