Skip to content

Commit 4fe89ac

Browse files
Add two bootstrap improvements
- Only reboot if it is really needed; - Do not go ahead on bootstrapping if pulseaudio, pipewire or wireplumber services were found.
1 parent 4e94b1b commit 4fe89ac

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

bootstrap.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ EUTHERPE_PASSWD=eutherpe
1111
SHOULD_SETUP_ETH_RESCUE_IFACE=0
1212
EUTHERPE_DEFAULT_PORT=8080
1313
SHOULD_BUILD_AND_INSTALL_BLUEZ_ALSA=1
14+
SHOULD_REBOOT=1
1415

1516
has_internet_conectivity() {
1617
result=0
@@ -418,6 +419,20 @@ else
418419
echo "=== Okay, you are root user :) let's start..."
419420
fi
420421

422+
if [[ `is_active pulseaudio` == 1 ]]; then
423+
echo "bootstrap warn: Eutherpe uses ALSA and bluez-ALSA, you need to uninstall or at least deactivate pulseaudio before proceeding." >&2
424+
echo "aborted."
425+
exit 1
426+
elif [[ `is_active pipewire` == 1 ]]; then
427+
echo "bootstrap warn: Eutherpe uses ALSA and bluez-ALSA, you need to uninstall or at least deactivate pipewire before proceeding." >&2
428+
echo "aborted."
429+
exit 1
430+
elif [[ `is_active wireplumber` == 1]]; then
431+
echo "boostrap warn: Eutherpe uses ALSA and bluez-ALSA, you need to uninstall or at least deactivate wireplumber before proceeding." >&2
432+
echo "aborted."
433+
exit 1
434+
fi
435+
421436
if [[ `is_active eutherpe` == 1 ]]; then
422437
echo "bootstrap info: An instance of eutherpe.service is running, let's stop it..."
423438
systemctl stop eutherpe
@@ -440,12 +455,14 @@ fi
440455

441456
if [[ `is_active bluealsa` == 1 ]]; then
442457
SHOULD_BUILD_AND_INSTALL_BLUEZ_ALSA=0
458+
SHOULD_REBOOT=0
443459
fi
444460

445461
if [[ `has_eutherpe_user` == 1 ]] ; then
446462
echo "=== Nice, $EUTHERPE_USER user already exists."
447463
elif [[ `add_eutherpe_user` == 0 ]] ; then
448464
echo "=== The $EUTHERPE_USER user was added."
465+
SHOULD_REBOOT=1
449466
fi
450467

451468
echo "=== bootstrap info: Adding $EUTHERPE_USER to sudo group..."
@@ -582,6 +599,9 @@ if [[ `is_active eutherpe-usb-watchdog` == 0 ]] ; then
582599
fi
583600

584601
echo "=== bootstrap info: Nice, eutherpe-usb-watchdog.service is running."
585-
echo "=== bootstrap info: Done. Reboot within 3 seconds..."
586-
587-
sleep 3 && shutdown -r now
602+
if [[ $SHOULD_REBOOT == 1 ]]; then
603+
echo "=== bootstrap info: Done. Reboot within 3 seconds..."
604+
sleep 3 && shutdown -r now
605+
else
606+
echo "=== bootstrap info: Done."
607+
fi

0 commit comments

Comments
 (0)