#!/bin/bash

BOARD_NAME=$(cat /sys/devices/platform/bone_capemgr/slot-0/board-name)
PART_NUM=$(cat /sys/devices/platform/bone_capemgr/slot-0/part-number)

# Function to start services based on part
start_scripts() {
    case $1 in
        nq-asb*)
            echo "Startup for ASB"
            /usr/local/bin/startup/asb
            ;;
        nq-mix*)
            echo "Startup for Mixer"
            ;;
        nq-voip*)
            echo "Startup for VoIP Speaker v1"
            /usr/local/bin/startup/voip
            ;;
        nq-edp01*)
            echo "Startup for Entry Door Phone"
            /usr/local/bin/startup/edp01
            ;;
        nq-s810v2* | nq-s810v3*)
            echo "Startup for $1"
            /usr/local/bin/startup/voip
            ;;
        nq-a?xxx*)
            NUM_CHANNELS=${1:4:1}
            if [[ $1 == *"g2"* ]]; then
                echo "Startup for $1  G2"
            else
                echo "Startup for $1  G1"
            fi
            ;;
        nq-ga10p* | nq-ga10pv*)
            echo "Startup for GA10P/V"
            ;;
        nq-ga20p*)
            echo "Startup for GA20P"
            ;;
        nq-paxxx*)
            echo "Startup for PAXXX"
            ;;
        nq-ga400p*)
            echo "Startup for GA400P"
            ;;
        nq-ga40p3*)
            echo "Startup for GA40P3"
            ;;
        *)
            ;;
    esac
}

# Call function with PART_NUM
start_scripts "$PART_NUM"

# Create default standalone configuration file
/usr/local/bin/create_default_standalone_config