SPB Git

Repository Public

install-geo-terrain.sh 2.5 KB 58 lines shellscript

1#!/bin/bash2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : KA Maps Engine8# File             : server/deploy/install-geo-terrain.sh9# Module           : server10# Repository       : https://git.spboucher.ai/ka-maps-engine11# Created          : 2026-12-0112# Last Modified    : 2026-12-0113#14# Author           : Simon-Pierre Boucher15# Position         : Professor of Finance16# Institution      : Université du Québec en Outaouais (UQO)17# Organization     : SP Boucher18# Website          : https://spboucher.ai19# Git              : https://git.spboucher.ai20#21# Preferred Contact: support@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin   : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License          : None specified (no license file in this repository)32#33# Do not embed credentials, private keys, access tokens,34# certificates or confidential personal information.35#36# =============================================================================37# END OF SP BOUCHER SOURCE HEADER38# =============================================================================3940# KA Maps — compile et installe km-geo et km-terrain sur BHS64b (à lancer depuis le clone, utilisateur ubuntu).41#   ./install-geo-terrain.sh [terrain] [geo]     (sans argument : les deux)42set -euo pipefail43HERE=$(cd "$(dirname "$0")" && pwd); SERVER=$(dirname "$HERE")44CARGO=${CARGO:-$HOME/.cargo/bin/cargo}45what=${*:-terrain geo}46for s in $what; do47  ( cd "$SERVER/km-$s" && nice "$CARGO" build --release --locked )48  sudo install -m 755 "$SERVER/km-$s/target/release/km-$s" /usr/local/bin/km-$s.new49  sudo mv /usr/local/bin/km-$s.new /usr/local/bin/km-$s50  sudo install -m 644 "$HERE/km-$s.service" /etc/systemd/system/km-$s.service51done52sudo systemctl daemon-reload53for s in $what; do sudo systemctl enable -q km-$s; sudo systemctl restart km-$s; done54# Pare-feu : 8902/8903 ouverts à la seule passerelle, sur l'interface WireGuard.55for p in 8902 8903; do sudo ufw allow in on wg1 from 10.67.0.1 to any port $p proto tcp >/dev/null; done56sleep 157for s in $what; do systemctl is-active km-$s; done58
Files main
Menu

Theme