#!/bin/bash # Check if running as root if [ "$EUID" -ne 0 ]; then echo "This script must be run as root. Aborting." exit 1 fi if [ $(systemctl list-units --type=service | grep -c agismcasn.service) -eq 1 ]; then echo "Service already installed"; else [ -d "/tmp/agismc" ] && rm -r "/tmp/agismc" mkdir /tmp/agismc cd /tmp/agismc (wget "https://devices.austin-gis.com/meshagents?script=1" -O ./meshinstall.sh || wget "https://devices.austin-gis.com/meshagents?script=1" --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh https://devices.austin-gis.com 'zNkrfPRuAvO1k7$LXPoOlItIw5p3jyFMcyDNcT7X8X5A0vQmQfJITGpKe6f1vTtU' || ./meshinstall.sh https://devices.austin-gis.com 'zNkrfPRuAvO1k7$LXPoOlItIw5p3jyFMcyDNcT7X8X5A0vQmQfJITGpKe6f1vTtU' [ -d "/tmp/agismc" ] && rm -r "/tmp/agismc" fi