mirror of
https://github.com/YunoHost-Apps/syncthing_ynh.git
synced 2024-09-03 20:26:23 +02:00
Swicth checkports
This commit is contained in:
parent
a43f1527dc
commit
8656e21f00
1 changed files with 12 additions and 2 deletions
|
@ -59,20 +59,30 @@ ynh_app_setting_set $app path $path
|
||||||
ynh_app_setting_set $app user $user
|
ynh_app_setting_set $app user $user
|
||||||
ynh_app_setting_set $app channel $channel
|
ynh_app_setting_set $app channel $channel
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STANDARD MODIFICATIONS
|
||||||
|
#=================================================
|
||||||
|
# FIND AND OPEN A PORT
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Configuring firewall..."
|
||||||
|
|
||||||
# Check port availability
|
# Check port availability
|
||||||
sudo yunohost app checkport $GUIPORT
|
sudo yunohost app checkport $GUIPORT
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
echo Port $GUIPORT for Syncthing UI is not available.
|
echo Port $GUIPORT for Syncthing UI is not available.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
ynh_app_setting_set $app guiport $GUIPORT
|
||||||
|
|
||||||
sudo yunohost app checkport $SYNCPORT
|
sudo yunohost app checkport $SYNCPORT
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
echo Port $SYNCPORT is for Syncthing protocol is not available.
|
echo Port $SYNCPORT is for Syncthing protocol is not available.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Open port in firewall
|
# Open this port
|
||||||
sudo yunohost firewall allow TCP $SYNCPORT > /dev/null 2>&1
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $SYNCPORT
|
||||||
|
ynh_app_setting_set $app syncport $SYNCPORT
|
||||||
|
|
||||||
# Create $SYNCUSER user to run syncthing service
|
# Create $SYNCUSER user to run syncthing service
|
||||||
sudo useradd -m -d $SYNCHOME/ -s /bin/bash $SYNCUSER
|
sudo useradd -m -d $SYNCHOME/ -s /bin/bash $SYNCUSER
|
||||||
|
|
Loading…
Add table
Reference in a new issue