post_install() {

	echo "Starting GSM SMS Daemon(GSD)..."
	/usr/bin/systemctl enable gsd
	/usr/bin/systemctl start gsd
	
# Need to figure out which modem is on the board
cat <<EOF > /tmp/gnxid-modem.sh
    
    echo "We are now enabling the modem hardware init"
    echo "GNX_GSM=\$GNX_GSM"
    
    if [ -v GNX_GSM ]; then
        cfg=(\${GNX_GSM//:/ })
    	echo "GSM on \${cfg[0]}"
    	modem=$(basename \${cfg[1]}) 
    	echo "modem is \${modem}"
    	hwctl enable \${modem}
    fi

EOF
    
    gnxid -s /tmp/gnxid-modem.sh
}

post_upgrade() {
	/usr/bin/systemctl daemon-reload
}
