pedalboard-scripts/start-pedalboard.sh

50 lines
1.3 KiB
Bash
Raw Permalink Normal View History

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