mirror of
https://github.com/YunoHost-Apps/motioneye_ynh.git
synced 2024-09-03 19:46:09 +02:00
* fixed config destination typo * $final_path not bound, attepting "__APP__" * test: hard Coded directory * changed install and data dir references * I thought I had replaced etc/ with /etc * added python3-venv to dependencies * moved asset to install * undo source removal * debug: list all files in install dir * use local downloaded dev.tar.gz * update source reference to specific commit + no extract * updated manifest for fixes and info + systemd correct directory * Auto-update README * Update manifest.toml (Fixed CPE) Co-authored-by: Tagada <36127788+Tagadda@users.noreply.github.com> * Version to date ver Co-authored-by: Tagada <36127788+Tagadda@users.noreply.github.com> * Auto-update README * install: changed permissions * 660->664 * install: 664->666 chown commented * chown+777 (this does not feel right) * following motionEye's base (664 + motion:motion) * Auto-update README * moved permissions * add motion to dependencies * permission tests continue * 777 again * retry * reordered folder making * Linter (#12) by ericgaspar * linter * Auto-update README * Update LICENSE * Update manifest.toml * Auto-update README * Update manifest.toml * cleaning --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> * Auto-update README * v0.43.1b1 download test * fixed miss-quote * Auto-update README * Update manifest.toml * clean up? * __APP__ -> $app * venv, ip fix and ram fix * run directory * test install dir run * logs in app dir (should change later) * force-create directories (shouldn't these be made?) * updated folders, upgrade, restore and install usage * corrected directory references * what if we cant use /path? * fixed description * Auto-update README * minimized screenshot to be less than 512k --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Tagada <36127788+Tagadda@users.noreply.github.com> Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com>
79 lines
2.6 KiB
Bash
Executable file
79 lines
2.6 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
then
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
pushd $install_dir
|
|
python3 -m venv venv
|
|
venv/bin/pip install --upgrade pip
|
|
venv/bin/pip install source.tar.gz
|
|
popd
|
|
fi
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
#=================================================
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
|
#=================================================
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
|
|
|
ynh_add_nginx_config
|
|
|
|
ynh_add_systemd_config
|
|
|
|
yunohost service add $app --description="Web frontend for the motion daemon" --log="/var/log/$app/$app.log"
|
|
|
|
ynh_use_logrotate --non-append
|
|
|
|
#=================================================
|
|
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
|
|
#=================================================
|
|
# UPDATE A CONFIG FILE
|
|
#=================================================
|
|
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
|
|
|
ynh_add_config --template="../conf/motioneye.conf" --destination="$install_dir/motioneye.conf"
|
|
|
|
chmod 600 "$install_dir/motioneye.conf"
|
|
chown $app:$app "$install_dir/motioneye.conf"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|