mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
33 lines
748 B
Bash
Executable file
33 lines
748 B
Bash
Executable file
#!/bin/bash
|
||
|
||
# Exit on command errors and treat unset variables as an error
|
||
set -eu
|
||
|
||
# Load common variables and functions
|
||
source ./_common.sh
|
||
|
||
# Retrieve arguments
|
||
domain=$YNH_APP_ARG_DOMAIN
|
||
path=$YNH_APP_ARG_PATH
|
||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||
|
||
# Check domain/path availability
|
||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||
|| ynh_die "Path not available: ${domain}${path}"
|
||
|
||
if ! [ "$path" = "/" ]
|
||
then
|
||
ynh_die "Path must be /"
|
||
fi
|
||
|
||
# Save app settings
|
||
ynh_app_setting_set "$app" is_public "$is_public"
|
||
|
||
# Install the app
|
||
install_haste $domain $path $is_public
|
||
|
||
# Start Haste
|
||
sudo systemctl start "$app".service
|
||
|
||
# Add Haste to YunoHost's monitored services
|
||
sudo yunohost service add "$app" --log /var/log/"$app"/"$app".log
|