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

View file

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