#!/bin/bash set -e force=$1 function safe_copy () { if [[ "$force" == "True" ]]; then sudo yunohost service safecopy \ -s nslcd \ $1 $2 \ --force else sudo yunohost service safecopy \ -s nslcd \ $1 $2 fi } cd /usr/share/yunohost/templates/nslcd safe_copy nslcd.conf /etc/nslcd.conf # Fix: Add a blank line at the end of the file # to avoid nscld restart failure echo -e "\n" | sudo tee -a /etc/nslcd.conf sudo service nslcd restart