mirror of
https://github.com/YunoHost-Apps/peertube_ynh.git
synced 2024-09-03 19:56:29 +02:00
Hook less scary for other packagers
This commit is contained in:
parent
be45aa443b
commit
1bbaee6aa3
1 changed files with 5 additions and 29 deletions
|
@ -1,31 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
force=${2:-0} # 0/1 --force argument
|
pending_conf=$4
|
||||||
dryrun=${3:-0} # 0/1 --dry-run argument
|
if [[ "$1" == "pre" ]]
|
||||||
pending_conf=$4 # Path of the pending conf file
|
then
|
||||||
|
sed --in-place "s/X-Frame-Options : SAMEORIGIN/X-Frame-Options : ALLOWALL/g" "${pending_conf}/../nginx/etc/nginx/conf.d/__DOMAIN__.conf"
|
||||||
do_pre_regen() {
|
fi
|
||||||
# Put your code here for pre regen conf.
|
|
||||||
sed --in-place "s/X-Frame-Options : SAMEORIGIN/X-Frame-Options : ALLOWALL/g" "${pending_conf}/../nginx/etc/nginx/conf.d/__DOMAIN__.conf"
|
|
||||||
}
|
|
||||||
|
|
||||||
do_post_regen() {
|
|
||||||
# Put your code here for post regen conf.
|
|
||||||
# Be careful, this part will be executed only if the configuration has been modified.
|
|
||||||
regen_conf_files=$1
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
pre)
|
|
||||||
do_pre_regen
|
|
||||||
;;
|
|
||||||
post)
|
|
||||||
do_post_regen
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Hook called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue