mirror of
https://github.com/YunoHost-Apps/duniter_ynh.git
synced 2024-09-03 18:26:35 +02:00
[enh] retrieve admin argument and store it.
This commit is contained in:
parent
38dddb4bba
commit
32d3690e90
3 changed files with 16 additions and 1 deletions
|
@ -92,7 +92,16 @@
|
||||||
},
|
},
|
||||||
"example": "50",
|
"example": "50",
|
||||||
"default": "50"
|
"default": "50"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": "admin",
|
||||||
|
"type": "user",
|
||||||
|
"ask": {
|
||||||
|
"en": "Administrator. Must a YunoHost user.",
|
||||||
|
"fr": "Administrateur. Ce doit être un utilisateur YunoHost"
|
||||||
|
},
|
||||||
|
"example": "jon doe"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ sync_node=$YNH_APP_ARG_SYNC_NODE
|
||||||
sync_port=$YNH_APP_ARG_SYNC_PORT
|
sync_port=$YNH_APP_ARG_SYNC_PORT
|
||||||
salt=$YNH_APP_ARG_SALT
|
salt=$YNH_APP_ARG_SALT
|
||||||
password=$YNH_APP_ARG_PASSWORD
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
cpu=`bc -l <<< "scale=2; $YNH_APP_ARG_CPU/100"`
|
cpu=`bc -l <<< "scale=2; $YNH_APP_ARG_CPU/100"`
|
||||||
version=$(cat ../conf/upstream_version)
|
version=$(cat ../conf/upstream_version)
|
||||||
|
|
||||||
|
@ -35,6 +36,9 @@ else
|
||||||
ynh_die "Node $sync_node:$sync_port is not available" 2
|
ynh_die "Node $sync_node:$sync_port is not available" 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check the admin exists in YunoHost users
|
||||||
|
ynh_user_exists $admin
|
||||||
|
|
||||||
# Get CPU architecture and check it
|
# Get CPU architecture and check it
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
if [ $arch == "x86_64" ]; then
|
if [ $arch == "x86_64" ]; then
|
||||||
|
@ -50,6 +54,7 @@ sudo yunohost firewall allow TCP $port > /dev/null 2>&1
|
||||||
# Store config on YunoHost instance
|
# Store config on YunoHost instance
|
||||||
ynh_app_setting_set $app port $port
|
ynh_app_setting_set $app port $port
|
||||||
ynh_app_setting_set $app arch $arch
|
ynh_app_setting_set $app arch $arch
|
||||||
|
ynh_app_setting_set "$app" admin "$admin"
|
||||||
|
|
||||||
# Retrieve debian package and install it
|
# Retrieve debian package and install it
|
||||||
wget -nc --quiet https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp
|
wget -nc --quiet https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp
|
||||||
|
|
|
@ -13,6 +13,7 @@ domain=$(ynh_app_setting_get "$app" domain)
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
path=$(ynh_app_setting_get "$app" path)
|
||||||
port=$(ynh_app_setting_get "$app" port)
|
port=$(ynh_app_setting_get "$app" port)
|
||||||
arch=$(ynh_app_setting_get "$app" arch)
|
arch=$(ynh_app_setting_get "$app" arch)
|
||||||
|
admin=$(ynh_app_setting_get "$app" admin)
|
||||||
version=$(cat ../conf/upstream_version)
|
version=$(cat ../conf/upstream_version)
|
||||||
|
|
||||||
# Check CPU arch
|
# Check CPU arch
|
||||||
|
|
Loading…
Reference in a new issue