audio-box/install.sh
jochen 8be0e562b8 Add samba and chrony installations
Enable remote debugging for i2c-amp-control
2022-01-14 17:36:26 +01:00

40 lines
812 B
Bash

#!/bin/bash
while [ True ]; do
if [ "$1" = "--dev" -o "$1" = "-d" ]; then
IS_DEV=true
shift 1
else
break
fi
done
if [ "#{0:0:1}" = "/" ]; then
spath=$0
else
spath=$PWD/$(dirname "$0")
fi
execute_script()
{
SERVICE=$1
read -p "Install service $SERVICE? (yes/NO): " xcute
xcute="${xcute,,}" # To lowercase
if [[ "$xcute" = "y" || "$xcute" = "yes" ]]; then
echo "------------------------------------ Installing $SERVICE ------------------------------------"
cd "$spath/$SERVICE" || return
. ./install.sh
echo "------------------------------------ $SERVICE installed ------------------------------------"
else
echo "Skipping installation of $SERVICE"
fi
}
execute_script i2c-amp-control
execute_script chrony
if [[ $IS_DEV ]]; then
execute_script samba
fi