1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/duniter_ynh.git synced 2024-09-03 18:26:35 +02:00

[fix/Enh] Nginx conf wasn't applied. Add set -eu.

- [fix] do not move in /twp directory. Manage Debian package from current directory.
- [enh] add 'set -eu' in install and update scripts. Remove it from remove script.
This commit is contained in:
Moul 2016-05-31 21:22:59 +00:00
parent d4fd65ba63
commit 5dc34890eb
3 changed files with 15 additions and 9 deletions

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
#set -e # Exit on command errors and treat unset variables as an error
set -eu
# Retrieve arguments # Retrieve arguments
app=duniter app=duniter
@ -43,17 +44,16 @@ sudo yunohost firewall allow TCP $port > /dev/null 2>&1
ynh_app_setting_set $app port $port ynh_app_setting_set $app port $port
# Install Duniter # Install Duniter
cd /tmp
arch=$(uname -m) arch=$(uname -m)
if [ $arch == "x86_64" ]; then if [ $arch == "x86_64" ]; then
arch="x64" arch="x64"
wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp
#elif [ $arch == "armv7l" ]; then #elif [ $arch == "armv7l" ]; then
# wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb # wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp
else else
ynh_die "$arch is not currently supported." 2 ynh_die "$arch is not currently supported." 2
fi fi
sudo dpkg -i duniter-$version-linux-$arch.deb sudo dpkg -i /tmp/duniter-$version-linux-$arch.deb
#sudo rm -f /tmp/duniter-$version-linux-$arch.deb #sudo rm -f /tmp/duniter-$version-linux-$arch.deb
#source ~/.bashrc #source ~/.bashrc

View file

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
#set -e
# Source app helpers # Source app helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers

View file

@ -1,8 +1,16 @@
#!/bin/bash #!/bin/bash
#set -e # Exit on command errors and treat unset variables as an error
set -eu
app=duniter app=duniter
# Stop duniter daemon
sudo $app stop
# Upgrade Duniter package # Upgrade Duniter package
$app restart #dpkg -r
#dpkg -i
# Start duniter daemon
sudo $app start