#!/bin/bash gitcommit=$(sudo grep revision /etc/yunohost/apps/hotspot/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/') tmpdir=$(mktemp -dp /tmp/ hotspot-restore-XXXXX) git clone https://github.com/labriqueinternet/hotspot_ynh.git "${tmpdir}/" git --work-tree "${tmpdir}/" --git-dir "${tmpdir}/.git/" reset --hard "${gitcommit}" cd "${tmpdir}/scripts/" bash ./upgrade sudo rm -r "${tmpdir}/" exit 0