[enh] Update avahi-daemon, glances and nsswitch conf_regen hooks

This commit is contained in:
Jérôme Lebleu 2016-04-13 22:27:43 +02:00
parent c09abeaec1
commit c8255fbc0c
6 changed files with 96 additions and 57 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View 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

View 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

View 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