2015-07-25 16:33:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
|
2016-05-14 21:24:20 +02:00
|
|
|
gitcommit=$(sudo grep revision /etc/yunohost/apps/hotspot/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/')
|
2015-07-25 16:33:38 +02:00
|
|
|
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/"
|
2018-05-04 00:33:01 +02:00
|
|
|
bash ./upgrade
|
2015-07-25 16:33:38 +02:00
|
|
|
|
2019-02-09 13:03:20 +01:00
|
|
|
ynh_secure_remove "${tmpdir}/"
|