1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00
haste_ynh/scripts/install
2016-10-26 00:28:51 +02:00

33 lines
748 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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