Traccar update script #332
Replies: 1 comment
-
#!/usr/bin/env bash Copyright (c) 2021-2024 tteckAuthor: tteck (tteckster)License: MIThttps://github.com/community-scripts/ProxmoxVE/raw/main/LICENSEsource /dev/stdin <<< "$FUNCTIONS_FILE_PATH" msg_info "Installing/Updating Traccar" Check if curl and unzip are installed. Install them if not.if ! command -v curl &>/dev/null || ! command -v unzip &>/dev/null; then Get the currently installed version (if Traccar is installed)if [[ -f /opt/traccar/VERSION ]]; then Get the latest available version from GitHub APIRELEASE=$(curl -s https://api.github.com/repos/traccar/traccar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') msg_info "Latest Traccar Version: ${RELEASE}" Compare versionsif [[ "$RELEASE" == "$INSTALLED_VERSION" ]]; then Download and install/update Traccarmsg_info "Downloading Traccar v${RELEASE}" msg_info "Installing/Upgrading Traccar" Upgrade: Stop the service before upgrading
Create a backup of the current installation (optional but recommended)msg_info "Backing up current Traccar installation" Extract the archive to /opt/ and rename the extracted directory
echo "${RELEASE}" > /opt/traccar/VERSION # Save the installed version Start the service. Check if service file exists first.if [[ -f /etc/systemd/system/traccar.service ]]; then [Service] [Install] rm -rf README.txt traccar-linux-64-${RELEASE}.zip # No need to remove traccar.run, it is inside the archive Cleanupmsg_info "Cleaning up" msg_ok "Traccar successfully installed/updated to v${RELEASE}" |
Beta Was this translation helpful? Give feedback.
-
Application Name
Traccar Modern GPS Tracking Platform
Website
https://www.traccar.org/
Description
Hello. Can you add an update to the existing traccar script? Thank you.
https://www.traccar.org/upgrading-traccar/
https://www.traccar.org/linux/
https://www.traccar.org/install-digitalocean/
Due Diligence
Beta Was this translation helpful? Give feedback.
All reactions