mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #651 from YunoHost/fix-missing-getopts
[fix] Loading only one helper file leads to errors because missing getopts
This commit is contained in:
commit
4ddfa6881f
17 changed files with 18 additions and 22 deletions
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ldap"
|
backup_dir="${1}/conf/ldap"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ssh"
|
backup_dir="${1}/conf/ssh"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ynh/mysql"
|
backup_dir="${1}/conf/ynh/mysql"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ssowat"
|
backup_dir="${1}/conf/ssowat"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/data/home"
|
backup_dir="${1}/data/home"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ynh/firewall"
|
backup_dir="${1}/conf/ynh/firewall"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ynh/certs"
|
backup_dir="${1}/conf/ynh/certs"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/data/mail"
|
backup_dir="${1}/data/mail"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/xmpp"
|
backup_dir="${1}/conf/xmpp"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/nginx"
|
backup_dir="${1}/conf/nginx"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/cron"
|
backup_dir="${1}/conf/cron"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Source YNH helpers
|
# Source YNH helpers
|
||||||
source /usr/share/yunohost/helpers.d/filesystem
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup destination
|
# Backup destination
|
||||||
backup_dir="${1}/conf/ynh"
|
backup_dir="${1}/conf/ynh"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
. /usr/share/yunohost/helpers.d/utils
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
do_pre_regen() {
|
do_pre_regen() {
|
||||||
pending_dir=$1
|
pending_dir=$1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
. /usr/share/yunohost/helpers.d/utils
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
do_init_regen() {
|
do_init_regen() {
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
MYSQL_PKG="mariadb-server-10.1"
|
MYSQL_PKG="mariadb-server-10.1"
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
do_pre_regen() {
|
do_pre_regen() {
|
||||||
pending_dir=$1
|
pending_dir=$1
|
||||||
|
@ -15,7 +16,6 @@ do_post_regen() {
|
||||||
regen_conf_files=$1
|
regen_conf_files=$1
|
||||||
|
|
||||||
if [ ! -f /etc/yunohost/mysql ]; then
|
if [ ! -f /etc/yunohost/mysql ]; then
|
||||||
. /usr/share/yunohost/helpers.d/string
|
|
||||||
|
|
||||||
# ensure that mysql is running
|
# ensure that mysql is running
|
||||||
sudo systemctl -q is-active mysql.service \
|
sudo systemctl -q is-active mysql.service \
|
||||||
|
@ -25,8 +25,6 @@ do_post_regen() {
|
||||||
mysql_password=$(ynh_string_random 10)
|
mysql_password=$(ynh_string_random 10)
|
||||||
sudo mysqladmin -s -u root -pyunohost password "$mysql_password" || {
|
sudo mysqladmin -s -u root -pyunohost password "$mysql_password" || {
|
||||||
if [ $FORCE -eq 1 ]; then
|
if [ $FORCE -eq 1 ]; then
|
||||||
. /usr/share/yunohost/helpers.d/package
|
|
||||||
|
|
||||||
echo "It seems that you have already configured MySQL." \
|
echo "It seems that you have already configured MySQL." \
|
||||||
"YunoHost needs to have a root access to MySQL to runs its" \
|
"YunoHost needs to have a root access to MySQL to runs its" \
|
||||||
"applications, and is going to reset the MySQL root password." \
|
"applications, and is going to reset the MySQL root password." \
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
do_pre_regen() {
|
do_pre_regen() {
|
||||||
pending_dir=$1
|
pending_dir=$1
|
||||||
|
|
||||||
# source ip helpers
|
|
||||||
. /usr/share/yunohost/helpers.d/ip
|
|
||||||
|
|
||||||
cd /usr/share/yunohost/templates/dnsmasq
|
cd /usr/share/yunohost/templates/dnsmasq
|
||||||
|
|
||||||
# create directory for pending conf
|
# create directory for pending conf
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
backup_dir="$1/conf/ynh/mysql"
|
backup_dir="$1/conf/ynh/mysql"
|
||||||
MYSQL_PKG="mariadb-server-10.1"
|
MYSQL_PKG="mariadb-server-10.1"
|
||||||
|
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# ensure that mysql is running
|
# ensure that mysql is running
|
||||||
service mysql status >/dev/null 2>&1 \
|
service mysql status >/dev/null 2>&1 \
|
||||||
|| service mysql start
|
|| service mysql start
|
||||||
|
@ -11,13 +13,11 @@ service mysql status >/dev/null 2>&1 \
|
||||||
new_pwd=$(sudo cat "${backup_dir}/root_pwd" || sudo cat "${backup_dir}/mysql")
|
new_pwd=$(sudo cat "${backup_dir}/root_pwd" || sudo cat "${backup_dir}/mysql")
|
||||||
[ -z "$curr_pwd" ] && curr_pwd="yunohost"
|
[ -z "$curr_pwd" ] && curr_pwd="yunohost"
|
||||||
[ -z "$new_pwd" ] && {
|
[ -z "$new_pwd" ] && {
|
||||||
. /usr/share/yunohost/helpers.d/string
|
|
||||||
new_pwd=$(ynh_string_random 10)
|
new_pwd=$(ynh_string_random 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
# attempt to change it
|
# attempt to change it
|
||||||
sudo mysqladmin -s -u root -p"$curr_pwd" password "$new_pwd" || {
|
sudo mysqladmin -s -u root -p"$curr_pwd" password "$new_pwd" || {
|
||||||
. /usr/share/yunohost/helpers.d/package
|
|
||||||
|
|
||||||
echo "It seems that you have already configured MySQL." \
|
echo "It seems that you have already configured MySQL." \
|
||||||
"YunoHost needs to have a root access to MySQL to runs its" \
|
"YunoHost needs to have a root access to MySQL to runs its" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue