pedalboard-scripts/start-pedalboard.sh

50 lines
No EOL
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# author: Daniel Sommer <daniel.sommer@velvettear.de>>>
# license: MIT
set -e
[[ "$EUID" != "0" ]] && printf "error: permission denied\n" && exit 1
source "./config.env"
printf "${FONT_BOLD}> starting pedalboard...${FONT_NORMAL}\n"
source "/usr/local/pisound/scripts/common/common.sh"
flash_leds 10
sleep 0.25
flash_leds 10
printf ">>> " && "/etc/velvettear/scripts/cpu-governor.sh" "performance"
printf ">>> starting MODEP..."
patchbox module activate modep &>>> /dev/null
printf " done!\n"
up="$(journalctl -u modep-touchosc2midi | tail -n1)"
while [[ "$up" != *"Waiting for first package from touchOSC"* ]]; do
printf ">>> waiting for touchosc2midi to come up...\n"
sleep 0.1
up="$(journalctl -u modep-touchosc2midi | tail -n1)"
done
printf ">>> sending message to touchosc2midi to wake it up...\n"
oscsend localhost 12101 / m 000000b0
if [[ ! -e "/etc/systemd/system/pbc.service" ]]; then
printf ">>> symlinking \'pbc.service\' to \'/etc/systemd/system\'..."
ln -s "/opt/pbc/pbc.service" "/etc/systemd/system/pbc.service" &>>> /dev/null
printf " done!\n"
printf ">>> reloading systemd services..."
systemctl daemon-reload &>>> /dev/null
printf " done!\n"
fi
printf ">>> starting pbc..."
systemctl start pbc &>>> /dev/null
printf " done!\n"
flash_leds 100
printf "${FONT_BOLD}> started pedalboard after "$SECONDS" seconds${FONT_NORMAL}\n"