#!/bin/bash # Exit on command errors and treat unset variables as an error set -eu # Source app helpers source /usr/share/yunohost/helpers # Get multi-instances specific variables app=$YNH_APP_INSTANCE_NAME # Retrieve arguments domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path) # Remove trailing "/" for next commands if [[ ! "$path" == "/" ]]; then path=${path%/} fi sudo apt-get update -qq sudo apt-get install shellinabox -y -qq # Copy shellinabox default configuration and restart sudo cp ../conf/shellinabox /etc/default/shellinabox sudo service shellinabox restart # Configure Nginx and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/shellinabox.conf sudo systemctl reload nginx