From 76a2219caff17060e6d6fc81cb61aae09d1488bf Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Feb 2022 20:14:34 +0100 Subject: [PATCH] Fix sudo --- scripts/_common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ae54329..b49e33a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -67,21 +67,21 @@ function setup_database() { # Load translation #param=" --without-demo True --addons-path $final_path/$appname/addons --db_user $app --db_password $db_pass --db_host 127.0.0.1 --db_port 5432 --db-filter '^$app\$' -d $app " param=" -c $conf_file -d $app " - sudo -u $app $bin_file -c $conf_file --stop-after-init -i base -d $app - sudo -u $app $bin_file -c $conf_file --stop-after-init -i auth_ldap -d $app - sudo -u $app $bin_file -c $conf_file --stop-after-init --load-language $lang -d $app + ynh_exec_as $app $bin_file -c $conf_file --stop-after-init -i base -d $app + ynh_exec_as $app $bin_file -c $conf_file --stop-after-init -i auth_ldap -d $app + ynh_exec_as $app $bin_file -c $conf_file --stop-after-init --load-language $lang -d $app # Configure language, timezone and ldap - sudo -u $app $bin_file shell -c $conf_file -d $app <<< \ + ynh_exec_as $app $bin_file shell -c $conf_file -d $app <<< \ " self.env['res.users'].search([['login', '=', 'admin']])[0].write({'password': '$admin_password'}) self.env.cr.commit() " - sudo -u $app $bin_file shell -c $conf_file -d $app <<< \ + ynh_exec_as $app $bin_file shell -c $conf_file -d $app <<< \ " self.write({'tz':'$tz','lang':'$lang'}) self.env.cr.commit() " - sudo -u $app $bin_file shell -c $conf_file -d $app <<< \ + ynh_exec_as $app $bin_file shell -c $conf_file -d $app <<< \ " template=env['res.users'].create({ 'login':'template',