#!/bin/bash

check_quectel_service() {  
    if lsusb | grep -q '2c7c:0125\|2c7c:0900'; then  
        service_status=$(systemctl is-enabled quectel.service)  
  
        if [ "$service_status" != "enabled" ]; then  
            sudo /leetop/quectel/quectel.sh  
        else  
            echo "Quectel service is already enabled."  
        fi  
    else  
        echo "No Quectel USB device found."  
    fi  
}  

check_ape_soundcard_and_execute() {  
    if grep -q 'APE' /proc/asound/cards; then  
        echo "APE soundcard found, executing script..."  
        sudo /leetop/code_spkmic.sh  
    else  
        echo "APE soundcard not found."  
    fi  
}  
  
depmod -a
check_ape_soundcard_and_execute
check_quectel_service

