#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)

. /etc/profile

if [ "${DEVICE_HAS_FAN}" == "true" ]
then
  #tocon "Enabling fan control..."
  nohup systemctl start fancontrol &
else
  nohup systemctl stop fancontrol &
fi

if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
then
  #tocon "Starting headphone service..."
  nohup systemctl start headphones &
else
  nohup systemctl stop headphones &
fi

if [ "${DEVICE_HAS_HDMI}" == "true" ]
then
  #tocon "Starting hdmi service..."
  nohup systemctl start video &
else
  nohup systemctl stop video &
fi

if [ "${DEVICE_BATTERY_LED_STATUS}" == "true" ]
then
  #tocon "Starting battery led status service..."
  nohup systemctl start batteryledstatus &
else
  nohup systemctl stop batteryledstatus &
fi

#tocon "Starting input service..."
nohup systemctl start input &
