mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Update avahi-daemon, glances and nsswitch conf_regen hooks
This commit is contained in:
parent
c09abeaec1
commit
c8255fbc0c
6 changed files with 96 additions and 57 deletions
|
@ -1,19 +0,0 @@
|
|||
set -e
|
||||
|
||||
force=$1
|
||||
|
||||
function safe_copy () {
|
||||
if [[ "$force" == "True" ]]; then
|
||||
sudo yunohost service safecopy \
|
||||
-s avahi-daemon $1 $2 --force
|
||||
else
|
||||
sudo yunohost service safecopy \
|
||||
-s avahi-daemon $1 $2
|
||||
fi
|
||||
}
|
||||
|
||||
cd /usr/share/yunohost/templates/avahi-daemon
|
||||
|
||||
if [[ "$(safe_copy avahi-daemon.conf /etc/avahi/avahi-daemon.conf | tail -n1)" == "True" ]]; then
|
||||
sudo service avahi-daemon restart
|
||||
fi
|
|
@ -1,19 +0,0 @@
|
|||
set -e
|
||||
|
||||
force=$1
|
||||
|
||||
function safe_copy () {
|
||||
if [[ "$force" == "True" ]]; then
|
||||
sudo yunohost service safecopy \
|
||||
-s glances $1 $2 --force
|
||||
else
|
||||
sudo yunohost service safecopy \
|
||||
-s glances $1 $2
|
||||
fi
|
||||
}
|
||||
|
||||
cd /usr/share/yunohost/templates/glances
|
||||
|
||||
if [[ "$(safe_copy glances.default /etc/default/glances | tail -n1)" == "True" ]]; then
|
||||
sudo service glances restart
|
||||
fi
|
|
@ -1,19 +0,0 @@
|
|||
set -e
|
||||
|
||||
force=$1
|
||||
|
||||
function safe_copy () {
|
||||
if [[ "$force" == "True" ]]; then
|
||||
sudo yunohost service safecopy \
|
||||
-s nsswitch $1 $2 --force
|
||||
else
|
||||
sudo yunohost service safecopy \
|
||||
-s nsswitch $1 $2
|
||||
fi
|
||||
}
|
||||
|
||||
cd /usr/share/yunohost/templates/nsswitch
|
||||
|
||||
if [[ "$(safe_copy nsswitch.conf /etc/nsswitch.conf | tail -n1)" == "True" ]]; then
|
||||
sudo service nscd restart
|
||||
fi
|
32
data/hooks/conf_regen/37-avahi-daemon
Executable file
32
data/hooks/conf_regen/37-avahi-daemon
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
do_pre_regen() {
|
||||
pending_dir=$1
|
||||
|
||||
cd /usr/share/yunohost/templates/avahi-daemon
|
||||
|
||||
install -D avahi-daemon.conf "${pending_dir}/etc/avahi/avahi-daemon.conf"
|
||||
}
|
||||
|
||||
do_post_regen() {
|
||||
sudo service avahi-daemon restart
|
||||
}
|
||||
|
||||
FORCE=$2
|
||||
|
||||
case "$1" in
|
||||
pre)
|
||||
do_pre_regen $3
|
||||
;;
|
||||
post)
|
||||
do_post_regen
|
||||
;;
|
||||
*)
|
||||
echo "hook called with unknown argument \`$status'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
32
data/hooks/conf_regen/40-glances
Executable file
32
data/hooks/conf_regen/40-glances
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
do_pre_regen() {
|
||||
pending_dir=$1
|
||||
|
||||
cd /usr/share/yunohost/templates/glances
|
||||
|
||||
install -D glances.default "${pending_dir}/etc/default/glances"
|
||||
}
|
||||
|
||||
do_post_regen() {
|
||||
sudo service glances restart
|
||||
}
|
||||
|
||||
FORCE=$2
|
||||
|
||||
case "$1" in
|
||||
pre)
|
||||
do_pre_regen $3
|
||||
;;
|
||||
post)
|
||||
do_post_regen
|
||||
;;
|
||||
*)
|
||||
echo "hook called with unknown argument \`$status'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
32
data/hooks/conf_regen/46-nsswitch
Executable file
32
data/hooks/conf_regen/46-nsswitch
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
do_pre_regen() {
|
||||
pending_dir=$1
|
||||
|
||||
cd /usr/share/yunohost/templates/nsswitch
|
||||
|
||||
install -D nsswitch.conf "${pending_dir}/etc/nsswitch.conf"
|
||||
}
|
||||
|
||||
do_post_regen() {
|
||||
sudo service nscd restart
|
||||
}
|
||||
|
||||
FORCE=$2
|
||||
|
||||
case "$1" in
|
||||
pre)
|
||||
do_pre_regen $3
|
||||
;;
|
||||
post)
|
||||
do_post_regen
|
||||
;;
|
||||
*)
|
||||
echo "hook called with unknown argument \`$status'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Add table
Reference in a new issue