#!/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