mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-18 04:32:23 -05:00
streamer movement
This commit is contained in:
+25
-44
@@ -1,48 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Installer entry point for roverd hosts.
|
||||
#
|
||||
# The detailed work lives in rover/install/*.sh so platform-specific setup stays
|
||||
# local to the profile that needs it. This file should read like the install
|
||||
# order: choose a profile, validate inputs, install shared roverd pieces,
|
||||
# install profile support, then enable the services.
|
||||
|
||||
# Installs from an existing checkout. Standalone bootstrap is a later stage.
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||
|
||||
# The helper scripts use repository-relative paths because those same paths are
|
||||
# shown in docs and logs. Moving to the repository root once keeps every module
|
||||
# simple and prevents each function from needing its own path resolver.
|
||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
source rover/install/common.sh
|
||||
source rover/install/profiles.sh
|
||||
[[ $EUID == 0 ]] || { echo 'Run as root' >&2; exit 1; }
|
||||
case "$(dpkg --print-architecture)" in
|
||||
amd64) arch=amd64 ;; arm64) arch=arm64 ;; armhf) arch=armv6 ;;
|
||||
*) echo 'Unsupported OS architecture' >&2; exit 1 ;;
|
||||
esac
|
||||
install -m 0755 "dist/roverd-linux-$arch" /usr/local/bin/roverd
|
||||
install -d /etc/roverd/profiles /var/lib/roverd
|
||||
if [[ ! -f /etc/roverd.json ]]; then
|
||||
/usr/local/bin/roverd -print-default-config > /etc/roverd.json
|
||||
chmod 600 /etc/roverd.json
|
||||
echo 'Set name, serverUrl, devices, and enabled profiles in /etc/roverd.json before starting roverd.'
|
||||
fi
|
||||
install -m 0644 rover/systemd/roverd.service /etc/systemd/system/roverd.service
|
||||
# Use this checkout directly for catalogs and command resources.
|
||||
install -d /etc/systemd/system/roverd.service.d
|
||||
printf '[Service]\nExecStart=\nExecStart=/usr/local/bin/roverd -config /etc/roverd.json -repo "%s"\n' "$REPO_ROOT" > /etc/systemd/system/roverd.service.d/repository.conf
|
||||
install -m 0755 rover/bin/chromegtts-daemon.py /usr/local/bin/chromegtts-daemon
|
||||
bash rover/bin/setup-tts.sh
|
||||
log() { echo "$*"; }
|
||||
source rover/install/self_update.sh
|
||||
source rover/install/pi_profile.sh
|
||||
source rover/install/debian_laptop_profile.sh
|
||||
source rover/install/media_env.sh
|
||||
source rover/install/systemd.sh
|
||||
|
||||
main() {
|
||||
parse_args "$@"
|
||||
select_profile
|
||||
require_root
|
||||
validate_install_inputs
|
||||
|
||||
install_roverd_binary
|
||||
install_self_update_support
|
||||
install_roverd_config
|
||||
install_roverd_unit
|
||||
|
||||
install_selected_profile
|
||||
install_media_units
|
||||
write_media_env_placeholder
|
||||
install_audio_fifo
|
||||
enable_and_restart_units
|
||||
|
||||
log "Install complete for profile $PROFILE"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
install_self_update_support
|
||||
systemctl daemon-reload
|
||||
systemctl enable roverd.service
|
||||
echo 'Installed. Run systemctl restart roverd after configuring this rover.'
|
||||
|
||||
Reference in New Issue
Block a user