#!/bin/bash set -e force=$1 function safe_copy () { if [[ "$force" == "True" ]]; then sudo yunohost service safecopy \ -s mysql $1 $2 --force else sudo yunohost service safecopy \ -s mysql $1 $2 fi } cd /usr/share/yunohost/templates/mysql if [[ "$(safe_copy my.cnf /etc/mysql/my.cnf)" == "True" ]]; then sudo service mysql restart fi