26 lines
626 B
Bash
26 lines
626 B
Bash
#!/bin/bash
|
|
|
|
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
|