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

[enh] install/remove scripts: use new shell helpers from YunoHost 2.4.

This commit is contained in:
Moul 2016-05-31 13:26:06 +00:00
parent a09f1540af
commit 37d8575af7
2 changed files with 10 additions and 5 deletions

View file

@ -13,6 +13,9 @@ salt=$6
password=$7
cpu=`bc -l <<< "scale=2; $8/100"`
# Source app helpers
source /usr/share/yunohost/helpers
# Check domain/path availability
sudo yunohost app checkurl $domain$path -a $app
if [[ ! $? -eq 0 ]]; then
@ -29,15 +32,14 @@ fi
if curl --output /dev/null --silent --head --fail "$sync_node:$sync_port/node/summary"; then
echo "Node $sync_node:$sync_port is available"
else
echo "Node $sync_node:$sync_port is not available"
exit 1
ynh_die "Node $sync_node:$sync_port is not available" 2
fi
# Open port on firewall
sudo yunohost firewall allow TCP $port > /dev/null 2>&1
# Store config on YunoHost instance
sudo yunohost app setting $app port -v $port
ynh_app_setting_set $app port $port
# Install Duniter
cd /tmp

View file

@ -2,9 +2,12 @@
#set -e
# Source app helpers
source /usr/share/yunohost/helpers
app=duniter
domain=$(sudo yunohost app setting $app domain)
port=$(sudo yunohost app setting $app port)
domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port)
# Remove Duniter
source ~/.bashrc