[fix] Backport fixes from my old dev branch.
This commit is contained in:
@@ -14,11 +14,21 @@
|
||||
"name": "pitchum",
|
||||
"email": "pitchum@users.noreply.github.com"
|
||||
},
|
||||
"multi_instance": "false",
|
||||
"multi_instance": false,
|
||||
"requirements": {
|
||||
"yunohost": ">= 2.2.0",
|
||||
"moulinette": ">= 2.4.0"
|
||||
},
|
||||
"services": [
|
||||
"nginx",
|
||||
"php5-fpm",
|
||||
"ynh-vpnclient"
|
||||
],
|
||||
"arguments": {
|
||||
"install" : [
|
||||
"install": [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for the web administration",
|
||||
"fr": "Choisissez un domaine pour l'administration web"
|
||||
@@ -27,6 +37,7 @@
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for the web administration",
|
||||
"fr": "Choisissez un chemin pour l'administration web"
|
||||
|
@@ -51,17 +51,28 @@ app=$YNH_APP_INSTANCE_NAME
|
||||
final_path="/var/www/$app"
|
||||
test ! -e "$final_path" || ynh_die "Path is already in use: ${final_path}."
|
||||
|
||||
source ./helpers
|
||||
source ./prerequisites
|
||||
# Normalize the url path syntax
|
||||
path_url=$(ynh_normalize_url_path "$path_url")
|
||||
|
||||
# Check domain/path availability
|
||||
if ! $upgrade; then
|
||||
ynh_webpath_register vpnclient $domain $url_path || exit 1
|
||||
fi
|
||||
# Check web path availability
|
||||
ynh_webpath_available "$domain" "$path_url"
|
||||
# Register (book) web path
|
||||
ynh_webpath_register "$app" "$domain" "$path_url"
|
||||
|
||||
# Install packages
|
||||
packages='php5-fpm sipcalc dnsutils openvpn curl fake-hwclock'
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
|
||||
ynh_app_setting_set "$app" domain "$domain"
|
||||
ynh_app_setting_set "$app" final_path "$final_path"
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
ynh_install_app_dependencies "$pkg_dependencies"
|
||||
|
||||
#=================================================
|
||||
# DEPLOY FILES FROM PACKAGE
|
||||
|
@@ -17,11 +17,24 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
source ./helpers
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$(sudo yunohost app setting vpnclient domain)
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
|
||||
#=================================================
|
||||
# The End
|
||||
ynh_systemctl stop ynh-vpnclient-checker.service
|
||||
sudo systemctl disable ynh-vpnclient-checker.service
|
||||
|
@@ -1,21 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
source _common.sh
|
||||
|
||||
|
||||
ynh_setting() {
|
||||
app=${1}
|
||||
setting=${2}
|
||||
|
||||
sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
|
||||
}
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
|
Reference in New Issue
Block a user