mirror of
https://github.com/YunoHost-Apps/simplex_ynh.git
synced 2024-09-03 20:26:28 +02:00
fix
This commit is contained in:
parent
866603d1d5
commit
f13ece7df3
3 changed files with 18 additions and 4 deletions
|
@ -46,6 +46,6 @@ ram.runtime = "50M"
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
dir = "/usr/local/bin/__APP__"
|
dir = "/usr/local/bin/simplex"
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
|
|
|
@ -27,8 +27,15 @@ chmod +x $install_dir/smp-server
|
||||||
|
|
||||||
pushd "$install_dir"
|
pushd "$install_dir"
|
||||||
public_ip4="$(curl -s ip.yunohost.org)" || true
|
public_ip4="$(curl -s ip.yunohost.org)" || true
|
||||||
ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4
|
public_ip6="$(curl -s ipv6.yunohost.org)" || true
|
||||||
./smp-server init --no-password --ip $public_ip4 -y
|
#ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4
|
||||||
|
|
||||||
|
if ( [[ -n "$public_ip4" ]] && ynh_validate_ip4 --ip_address="$public_ip4" || [[ -n "$public_ip6" ]] && ynh_validate_ip6 --ip_address="$public_ip6" )
|
||||||
|
then
|
||||||
|
echo "external-ip=${public_ip4}/${public_ip6}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
./smp-server init --no-password --ip $external-ip -y
|
||||||
popd
|
popd
|
||||||
|
|
||||||
fingerprint=$(cat /etc/opt/simplex/fingerprint)
|
fingerprint=$(cat /etc/opt/simplex/fingerprint)
|
||||||
|
|
|
@ -20,8 +20,15 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
public_ip4="$(curl -s ip.yunohost.org)" || true
|
public_ip4="$(curl -s ip.yunohost.org)" || true
|
||||||
|
public_ip6="$(curl -s ipv6.yunohost.org)" || true
|
||||||
|
|
||||||
|
if ( [[ -n "$public_ip4" ]] && ynh_validate_ip4 --ip_address="$public_ip4" || [[ -n "$public_ip6" ]] && ynh_validate_ip6 --ip_address="$public_ip6" )
|
||||||
|
then
|
||||||
|
echo "external-ip=${public_ip4}/${public_ip6}"
|
||||||
|
ynh_app_setting_set --app=$app --key=external-ip --value=$external-ip
|
||||||
|
fi
|
||||||
|
|
||||||
fingerprint=$(cat /etc/opt/simplex/fingerprint)
|
fingerprint=$(cat /etc/opt/simplex/fingerprint)
|
||||||
ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4
|
|
||||||
ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
|
ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue