#!/bin/sh # Залить esim-tools на роутер без доступа к git с роутера и установить: # tools/push.sh root@192.168.1.1 set -eu host=${1:?usage: tools/push.sh root@} cd "$(dirname "$0")/.." # ustar без метаданных macOS: busybox tar на OpenWrt не понимает pax/xattr COPYFILE_DISABLE=1 tar --no-xattrs --format ustar -czf - install.sh router luci | ssh "$host" 'mkdir -p /etc/esim-tools && rm -rf /etc/esim-tools/router /etc/esim-tools/luci && tar xzf - -C /etc/esim-tools' ver="$(git describe --always --dirty 2>/dev/null || echo '?') push $(date '+%Y-%m-%d %H:%M')" ssh "$host" "echo '$ver' > /etc/esim-tools/VERSION && sh /etc/esim-tools/install.sh"