mirror of
https://github.com/YunoHost-Apps/jitsi_ynh.git
synced 2024-09-03 19:35:57 +02:00
Adding hook
For metronome regen
This commit is contained in:
parent
2de3eb655f
commit
ca0a3bf24c
7 changed files with 84 additions and 1 deletions
53
conf/metronome_regenconf_hook
Normal file
53
conf/metronome_regenconf_hook
Normal file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
|
||||
force=${2:-0} # 0/1 --force argument
|
||||
dryrun=${3:-0} # 0/1 --dry-run argument
|
||||
pending_conf=$4 # Path of the pending conf file
|
||||
|
||||
# Define a temporary directory
|
||||
temp_dir=/tmp/jitsi.bck
|
||||
|
||||
# Retrieve Jitsi domain name
|
||||
domain="$(yunohost app setting jitsi domain)"
|
||||
|
||||
do_pre_regen() {
|
||||
if [ $dryrun -eq 0 ]
|
||||
then
|
||||
# Create temporary directory
|
||||
mkdir $temp_dir
|
||||
|
||||
# Backup metronome config
|
||||
cp -a "/etc/metronome/conf.d/$domain.cfg.lua" "$temp_dir/$domain.cfg.lua"
|
||||
fi
|
||||
}
|
||||
|
||||
do_post_regen() {
|
||||
# Backup Jitsi domain files
|
||||
mv -f /etc/metronome/conf.d/$domain.cfg.lua /etc/metronome/conf.d/$domain.cfg.lua.back
|
||||
mv -f /etc/metronome/conf.d/auth.$domain.cfg.lua /etc/metronome/conf.d/auth.$domain.cfg.lua.back
|
||||
mv -f /etc/metronome/conf.d/conference.$domain.cfg.lua /etc/metronome/conf.d/conference.$domain.cfg.lua.back
|
||||
mv -f /etc/metronome/conf.d/jitsi-videobridge.$domain.cfg.lua /etc/metronome/conf.d/jitsi-videobridge.$domain.cfg.lua.back
|
||||
mv -f /etc/metronome/conf.d/focus.$domain.cfg.lua /etc/metronome/conf.d/focus.$domain.cfg.lua.back
|
||||
|
||||
# Restore metronome config
|
||||
cp -f "$temp_dir/$domain.cfg.lua" "/etc/metronome/conf.d/$domain.cfg.lua"
|
||||
|
||||
# Delete temporary directory
|
||||
test -n $temp_dir && rm -r $temp_dir
|
||||
|
||||
# Reload metronome
|
||||
systemctl reload metronome
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
pre)
|
||||
do_pre_regen
|
||||
;;
|
||||
post)
|
||||
do_post_regen
|
||||
;;
|
||||
*)
|
||||
echo "Hook called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Video conferencing web application",
|
||||
"fr": "Application web de conférence vidéo"
|
||||
},
|
||||
"version": "1.0.3387~ynh1",
|
||||
"version": "1.0.3387~ynh2",
|
||||
"url": "https://jitsi.org/Projects/JitMeet",
|
||||
"license": "Apache-2.0",
|
||||
"maintainer": {
|
||||
|
|
|
@ -56,6 +56,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
#=================================================
|
||||
# BACKUP CONF_REGEN HOOK
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/50-metronome_$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
|
|
|
@ -123,6 +123,12 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# SET UP CONF_REGEN HOOK
|
||||
#=================================================
|
||||
|
||||
cp ../conf/metronome_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-metronome_$app
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE METRONOME
|
||||
#=================================================
|
||||
|
|
|
@ -109,6 +109,12 @@ fi
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
# REMOVE CONF_REGEN HOOK
|
||||
#=================================================
|
||||
|
||||
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/50-metronome_$app"
|
||||
|
||||
#=================================================
|
||||
# RECONFIGURE METRONOME
|
||||
#=================================================
|
||||
|
|
|
@ -80,6 +80,12 @@ chown -R root: $final_path
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# RESTORE CONF_REGEN HOOK
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/50-metronome_$app"
|
||||
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
|
|
@ -110,6 +110,12 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
# UPGRADE CONF_REGEN HOOK
|
||||
#=================================================
|
||||
|
||||
cp -f ../conf/metronome_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-metronome_$app
|
||||
|
||||
#=================================================
|
||||
# BUILD JITSI-VIDEOBRIDGE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue