Build legacy drivers and publish per-OS packages with web activation and DEB
This commit is contained in:
17
install-gateway.sh
Executable file
17
install-gateway.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
[[ $EUID == 0 ]] || { echo 'Use sudo ./install-gateway.sh' >&2; exit 1; }
|
||||
[[ -x build/mars_vme && -x build/mars-pcapd ]] || { echo 'First run make all native check-gateway' >&2; exit 1; }
|
||||
[[ -x /usr/local/sbin/nwserv && -f /usr/local/etc/mars_nwe/nwserv.conf && -f /etc/systemd/system/mars_vme.service ]] || { echo 'Requires existing installed 0.4 server; otherwise run build.sh + install.sh.' >&2; exit 1; }
|
||||
command -v nft >/dev/null && command -v ip >/dev/null || { echo 'Install nftables and iproute2 first' >&2; exit 1; }
|
||||
systemctl stop mars_vme.service
|
||||
backup="/var/lib/mars-vme/pre-gateway-$(date +%Y%m%d-%H%M%S)-$$"
|
||||
install -d -m 0700 "$backup"
|
||||
cp -a /usr/local/sbin/mars_vme /usr/local/sbin/mars-pcapd /usr/local/share/mars-vme/www "$backup/"
|
||||
install -D -m 0755 packaging/mars-ipxpkt-net /usr/local/libexec/mars-ipxpkt-net
|
||||
install -D -m 0755 publish-mtcp.sh /usr/local/sbin/mars-publish-mtcp
|
||||
install -D -m 0755 publish-winclient.sh /usr/local/sbin/mars-publish-winclient
|
||||
install -m 0755 build/mars_vme build/mars-pcapd /usr/local/sbin/
|
||||
for f in index.html app.js style.css login.html login.js; do install -m 0644 "websetup/$f" "/usr/local/share/mars-vme/www/$f"; done
|
||||
printf 'Gateway upgrade installed. Old executables/assets: %s\nStart: systemctl start mars_vme.service\n' "$backup"
|
||||
Reference in New Issue
Block a user