mirror of
https://github.com/YunoHost-Apps/duniter_ynh.git
synced 2024-09-03 18:26:35 +02:00
[enh] store $arch and retrieve it in upgrade script.
This commit is contained in:
parent
34f9d6f821
commit
200e5b12d8
2 changed files with 13 additions and 8 deletions
|
@ -37,17 +37,20 @@ else
|
|||
ynh_die "Node $sync_node:$sync_port is not available" 2
|
||||
fi
|
||||
|
||||
# Get CPU architecture
|
||||
arch=$(uname -m)
|
||||
if [ $arch == "x86_64" ]; then
|
||||
arch="x64"
|
||||
fi
|
||||
|
||||
# Open port on firewall
|
||||
sudo yunohost firewall allow TCP $port > /dev/null 2>&1
|
||||
|
||||
# Store config on YunoHost instance
|
||||
ynh_app_setting_set $app port $port
|
||||
ynh_app_setting_set $app arch $arch
|
||||
|
||||
# Install Duniter
|
||||
arch=$(uname -m)
|
||||
if [ $arch == "x86_64" ]; then
|
||||
arch="x64"
|
||||
fi
|
||||
if [ $arch == "x64" ]; then #|| $arch == "armv7l" ]
|
||||
wget -nc --quiet https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp
|
||||
else
|
||||
|
|
|
@ -3,7 +3,12 @@
|
|||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
# Source app helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Retrive CPU architecure
|
||||
app=duniter
|
||||
arch=$(ynh_app_setting_get "$app" arch)
|
||||
version=$(cat ../conf/upstream_version)
|
||||
|
||||
# Stop duniter daemon
|
||||
|
@ -13,16 +18,13 @@ sudo $app stop
|
|||
sudo dpkg -r duniter
|
||||
|
||||
# Retrive Duniter package and install it
|
||||
arch=$(uname -m)
|
||||
if [ $arch == "x86_64" ]; then
|
||||
arch="x64"
|
||||
fi
|
||||
if [ $arch == "x64" ]; then #|| $arch == "armv7l" ]
|
||||
wget -nc --quiet https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp
|
||||
else
|
||||
ynh_die "$arch is not currently supported." 2
|
||||
fi
|
||||
sudo dpkg -i /tmp/duniter-$version-linux-$arch.deb
|
||||
#sudo rm -f /tmp/duniter-$version-linux-$arch.deb
|
||||
|
||||
# Start duniter daemon
|
||||
sudo $app start
|
||||
|
|
Loading…
Add table
Reference in a new issue