mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
Fix install miserably failing + other weird stuff
This commit is contained in:
parent
dc7139bed4
commit
0d2f5f5c40
4 changed files with 30 additions and 43 deletions
|
@ -20,17 +20,6 @@
|
||||||
incorrect_path=1
|
incorrect_path=1
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
change_url=0
|
change_url=0
|
||||||
;;; Levels
|
|
||||||
Level 1=auto
|
|
||||||
Level 2=auto
|
|
||||||
Level 3=auto
|
|
||||||
Level 4=na
|
|
||||||
Level 5=auto
|
|
||||||
Level 6=auto
|
|
||||||
Level 7=auto
|
|
||||||
Level 8=0
|
|
||||||
Level 9=0
|
|
||||||
Level 10=0
|
|
||||||
;;; Upgrade options
|
;;; Upgrade options
|
||||||
; commit=546fd17712c7a9df428a4f26e7f8e4394884aaaf
|
; commit=546fd17712c7a9df428a4f26e7f8e4394884aaaf
|
||||||
name=29 Jan 2019
|
name=29 Jan 2019
|
||||||
|
|
|
@ -104,6 +104,7 @@ ynh_app_setting_set --app=$app --key=domain --value="$domain"
|
||||||
ynh_app_setting_set --app=$app --key=wifi_ssid --value="$wifi_ssid"
|
ynh_app_setting_set --app=$app --key=wifi_ssid --value="$wifi_ssid"
|
||||||
ynh_app_setting_set --app=$app --key=wifi_passphrase --value="$wifi_passphrase"
|
ynh_app_setting_set --app=$app --key=wifi_passphrase --value="$wifi_passphrase"
|
||||||
ynh_app_setting_set --app=$app --key=firmware_nonfree --value="$firmware_nonfree"
|
ynh_app_setting_set --app=$app --key=firmware_nonfree --value="$firmware_nonfree"
|
||||||
|
ynh_app_setting_set --app=$app --key=service_name --value=$service_name
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -148,14 +149,6 @@ ynh_script_progression --message="Installing dependencies"
|
||||||
|
|
||||||
ynh_install_app_dependencies "$pkg_dependencies" "$packages"
|
ynh_install_app_dependencies "$pkg_dependencies" "$packages"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring nginx web server..."
|
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
|
||||||
ynh_add_nginx_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -168,15 +161,6 @@ ynh_system_user_create --username=$app
|
||||||
install -b -o root -g root -m 0440 ../conf/sudoers.conf /etc/sudoers.d/${app}_ynh
|
install -b -o root -g root -m 0440 ../conf/sudoers.conf /etc/sudoers.d/${app}_ynh
|
||||||
ynh_replace_string --match_string="__HOTSPOT_SYSUSER__" --replace_string="${app}" --target_file="/etc/sudoers.d/${app}_ynh"
|
ynh_replace_string --match_string="__HOTSPOT_SYSUSER__" --replace_string="${app}" --target_file="/etc/sudoers.d/${app}_ynh"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring php-fpm..."
|
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
|
||||||
ynh_add_fpm_config
|
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL CUSTOM SCRIPTS
|
# INSTALL CUSTOM SCRIPTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -220,7 +204,6 @@ ynh_app_setting_set --app=$app --key=ip4_dns0 --value=80.67.188.188
|
||||||
ynh_app_setting_set --app=$app --key=ip4_dns1 --value=80.67.169.12
|
ynh_app_setting_set --app=$app --key=ip4_dns1 --value=80.67.169.12
|
||||||
ynh_app_setting_set --app=$app --key=ip4_nat_prefix --value=10.0.242
|
ynh_app_setting_set --app=$app --key=ip4_nat_prefix --value=10.0.242
|
||||||
ynh_app_setting_set --app=$app --key=vpnclient --value=no
|
ynh_app_setting_set --app=$app --key=vpnclient --value=no
|
||||||
ynh_app_setting_set --app=$app --key=service_name --value=$service_name
|
|
||||||
|
|
||||||
if [[ -z $wifi_device ]]; then
|
if [[ -z $wifi_device ]]; then
|
||||||
ynh_app_setting_set --app=$app --key=service_enabled --value=0
|
ynh_app_setting_set --app=$app --key=service_enabled --value=0
|
||||||
|
@ -243,12 +226,12 @@ install -b -o root -g root -m 0644 ../conf/dnsmasq_dhcpdv4.conf.tpl /etc/dnsmasq
|
||||||
|
|
||||||
# Copy init script
|
# Copy init script
|
||||||
install -o root -g root -m 0755 ../conf/$service_name /usr/local/bin/
|
install -o root -g root -m 0755 ../conf/$service_name /usr/local/bin/
|
||||||
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="${phpversion}" --target_file="/usr/local/bin/$service_name"
|
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="${YNH_PHP_VERSION}" --target_file="/usr/local/bin/$service_name"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# COPY WEB SOURCES
|
# COPY WEB SOURCES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Copy web sources..."
|
ynh_script_progression --message="Setting up source files..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
mkdir -pm 0755 ${final_path}/
|
mkdir -pm 0755 ${final_path}/
|
||||||
|
@ -259,9 +242,25 @@ chmod -R 0644 ${final_path}/*
|
||||||
find ${final_path}/ -type d -exec chmod +x {} \;
|
find ${final_path}/ -type d -exec chmod +x {} \;
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIX CONFIGS
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Fix config..."
|
ynh_script_progression --message="Configuring nginx web server..."
|
||||||
|
|
||||||
|
# Create a dedicated nginx config
|
||||||
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# PHP-FPM CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring php-fpm..."
|
||||||
|
|
||||||
|
# Create a dedicated php-fpm config
|
||||||
|
ynh_add_fpm_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CONFIGURE HOSTAPD
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring hostapd..."
|
||||||
|
|
||||||
## hostapd
|
## hostapd
|
||||||
ynh_replace_string --match_string="^DAEMON_CONF=$" --replace_string="&/etc/hostapd/hostapd.conf" --target_file=/etc/init.d/hostapd
|
ynh_replace_string --match_string="^DAEMON_CONF=$" --replace_string="&/etc/hostapd/hostapd.conf" --target_file=/etc/init.d/hostapd
|
||||||
|
@ -273,6 +272,13 @@ echo "DAEMON_CONF=/etc/hostapd/hostapd.conf" > /etc/default/hostapd
|
||||||
# Fix sources
|
# Fix sources
|
||||||
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url}" --target_file="$final_path/config.php"
|
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url}" --target_file="$final_path/config.php"
|
||||||
|
|
||||||
|
# Set default inits
|
||||||
|
# The boot order of these services are important, so they are disabled by default
|
||||||
|
# and the ynh-hotspot service handles them.
|
||||||
|
systemctl disable hostapd --quiet
|
||||||
|
systemctl stop hostapd
|
||||||
|
systemctl unmask hostapd # On some system e.g. RPi, for some reason hostapd is masked after install ...
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -290,13 +296,6 @@ ynh_script_progression --message="Configuring a systemd service..."
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config --service=$service_name
|
ynh_add_systemd_config --service=$service_name
|
||||||
|
|
||||||
# Set default inits
|
|
||||||
# The boot order of these services are important, so they are disabled by default
|
|
||||||
# and the ynh-hotspot service handles them.
|
|
||||||
systemctl disable hostapd
|
|
||||||
systemctl stop hostapd
|
|
||||||
systemctl unmask hostapd # On some system e.g. RPi, for some reason hostapd is masked after install ...
|
|
||||||
|
|
||||||
# Remove IPv6 address set if there is a VPN installed
|
# Remove IPv6 address set if there is a VPN installed
|
||||||
if [[ $ip6_addr != none ]]; then
|
if [[ $ip6_addr != none ]]; then
|
||||||
if ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"; then
|
if ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"; then
|
||||||
|
|
|
@ -129,7 +129,7 @@ ynh_install_app_dependencies "$pkg_dependencies" "$packages"
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$service_name.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$service_name.service"
|
||||||
systemctl enable $service_name.service
|
systemctl enable $service_name.service --quiet
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
|
|
|
@ -36,7 +36,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
if [ -z $phpversion ]; then
|
if [ -z $phpversion ]; then
|
||||||
phpversion=7.0
|
phpversion=$YNH_PHP_VERSION
|
||||||
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
|
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -144,7 +144,6 @@ ynh_script_progression --message="Upgrading php-fpm configuration..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
|
Loading…
Add table
Reference in a new issue