From b694687a5cb138d0a6eb2c0b2c34af721377e0a5 Mon Sep 17 00:00:00 2001 From: pvincent Date: Thu, 3 Jul 2025 21:31:18 +0400 Subject: [PATCH] fix exec sudo with params --- bin/apply_auth_remote_ssh.bash | 3 +-- bin/export.bash | 3 +-- bin/import.bash | 2 +- bin/purge.bash | 3 +-- debian/install.bash | 3 +-- debian/install_zourit_style.bash | 3 +-- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/bin/apply_auth_remote_ssh.bash b/bin/apply_auth_remote_ssh.bash index 760ba9e..639a25b 100755 --- a/bin/apply_auth_remote_ssh.bash +++ b/bin/apply_auth_remote_ssh.bash @@ -1,8 +1,7 @@ #!/usr/bin/env bash # execute as root or use `sudo` -[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") - +[[ $(id -u) != 0 ]] && exec sudo -- $(dirname "$0")/$(basename "$0") $* # changes in /etc/sympa/auth.conf sed -i 's/.*host 192.168.1.254:389.*/\thost 127.0.0.1:389/' /etc/sympa/auth.conf diff --git a/bin/export.bash b/bin/export.bash index 6bd6308..3c4d395 100755 --- a/bin/export.bash +++ b/bin/export.bash @@ -46,7 +46,6 @@ function export { ### MAIN # execute as root or use `sudo` -[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") - +[[ $(id -u) != 0 ]] && exec sudo -- $(dirname "$0")/$(basename "$0") $* set -Eeu export diff --git a/bin/import.bash b/bin/import.bash index 048309a..767d691 100755 --- a/bin/import.bash +++ b/bin/import.bash @@ -138,7 +138,7 @@ function import { ## main # execute as root or use `sudo` -[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") +[[ $(id -u) != 0 ]] && exec sudo -- $(dirname "$0")/$(basename "$0") $* set -Eeu assert_file $* diff --git a/bin/purge.bash b/bin/purge.bash index c14e6a5..0176bd8 100755 --- a/bin/purge.bash +++ b/bin/purge.bash @@ -83,7 +83,6 @@ function export { ### MAIN # execute as root or use `sudo` -[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") - +[[ $(id -u) != 0 ]] && exec sudo -- $(dirname "$0")/$(basename "$0") $* set -Eeu purge diff --git a/debian/install.bash b/debian/install.bash index 507c1a7..f131d81 100755 --- a/debian/install.bash +++ b/debian/install.bash @@ -3,8 +3,7 @@ ## MAIN # execute as root or use `sudo` -[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") - +[[ $(id -u) != 0 ]] && exec sudo -- $(dirname "$0")/$(basename "$0") $* apt install -y postfix postgresql nginx fcgiwrap perl-doc certbot echo TO BE continued... \ No newline at end of file diff --git a/debian/install_zourit_style.bash b/debian/install_zourit_style.bash index 89372c0..e866f84 100755 --- a/debian/install_zourit_style.bash +++ b/debian/install_zourit_style.bash @@ -3,8 +3,7 @@ ## MAIN # execute as root or use `sudo` -[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") - +[[ $(id -u) != 0 ]] && exec sudo -- $(dirname "$0")/$(basename "$0") $* # changes in /usr/share/sympa/lib/Sympa/Config/Schema.pm sed -i "s/.*005ab2.*/ default => '#ad0c78', # '#005ab2' replaced by ZOURIT-COLOR-1/" /usr/share/sympa/lib/Sympa/Config/Schema.pm sed -i "s/.*004b94.*/ default => '#1f2937', # '#004b94' replaced by ZOURIT-COLOR-2/" /usr/share/sympa/lib/Sympa/Config/Schema.pm