1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiddlywiki_ynh.git synced 2024-09-03 20:26:34 +02:00
tiddlywiki_ynh/scripts/install

55 lines
1.6 KiB
Text
Raw Normal View History

2021-02-16 13:38:59 +01:00
#!/bin/bash
2021-02-16 14:17:45 +01:00
source _common.sh
2021-02-16 13:38:59 +01:00
source /usr/share/yunohost/helpers
2021-02-16 14:17:45 +01:00
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression "Installing dependencies..."
2021-02-16 14:17:45 +01:00
ynh_nodejs_install
2021-02-16 14:17:45 +01:00
2021-02-16 13:38:59 +01:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
2021-02-16 13:38:59 +01:00
2023-03-12 22:15:34 +01:00
ynh_setup_source --dest_dir="$install_dir"
2021-02-16 13:38:59 +01:00
#=================================================
2023-03-12 22:29:28 +01:00
# SYSTEM CONFIGURATION
2021-02-16 13:38:59 +01:00
#=================================================
ynh_script_progression "Adding system configurations related to $app..."
2021-02-16 13:38:59 +01:00
ynh_config_add_nginx
2021-02-16 13:38:59 +01:00
ynh_config_add_systemd
2023-03-12 22:29:28 +01:00
2024-06-23 09:25:57 +02:00
yunohost service add $app --description="Non-linear personal web notebook" --log="/var/log/$app/$app.log"
2023-03-12 22:29:28 +01:00
2022-07-03 16:40:34 +02:00
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression "Configuring $app..."
2021-02-16 16:37:57 +01:00
2023-03-12 22:15:34 +01:00
if [ ! -f $data_dir/tiddlywiki.info ]
2022-07-04 21:33:57 +02:00
then
2023-03-12 22:15:34 +01:00
pushd $install_dir
2024-06-23 16:28:50 +02:00
ynh_hide_warnings ynh_exec_as_app --preserve-env=PATH ./tiddlywiki.js $data_dir --init server
2022-07-04 21:33:57 +02:00
popd
fi
2021-06-24 19:20:05 +02:00
2021-02-16 14:17:45 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
2021-02-16 14:17:45 +01:00
ynh_systemctl --service=$app --action="start" --log_path="systemd" --wait_until="Serving on"
2021-02-16 14:17:45 +01:00
2021-02-16 13:38:59 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Installation of $app completed"