yunohost/data/hooks/conf_regen/46-nsswitch

35 lines
460 B
Bash
Executable file

#!/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() {
regen_conf_files=$1
[[ -z "$regen_conf_files" ]] \
|| sudo service nscd restart
}
FORCE=$2
case "$1" in
pre)
do_pre_regen $3
;;
post)
do_post_regen $3
;;
*)
echo "hook called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0