From 9fa560e5c2472ee4267241760110234e90dc64c2 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Fri, 21 Apr 2023 17:23:04 +0800 Subject: [PATCH] bug fix (Fri Apr 21 17:23:03 CST 2023) --- scripts/jumpserver_deploy.sh | 2 +- scripts/testbed_cron.sh | 4 ++-- scripts/testbed_deploy.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/jumpserver_deploy.sh b/scripts/jumpserver_deploy.sh index 5fe22c8..0f4ee0c 100755 --- a/scripts/jumpserver_deploy.sh +++ b/scripts/jumpserver_deploy.sh @@ -20,4 +20,4 @@ insert_if_not_exist() insert_if_not_exist "/etc/crontab" "*/5 * * * * cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/jumpserver_cron.sh" -\"$THIS_DIR\"/jumpserver_cron.sh +"$THIS_DIR"/jumpserver_cron.sh diff --git a/scripts/testbed_cron.sh b/scripts/testbed_cron.sh index b061946..ed2f833 100755 --- a/scripts/testbed_cron.sh +++ b/scripts/testbed_cron.sh @@ -7,7 +7,7 @@ touch_user() { if id -u $1 1>/dev/null 2>&1; then return fi - if ! id -g nasp 1>/dev/null 2>&1; then + if ! getent group nasp ; then echo "Group 'nasp' does not exist\!" exit 1 fi @@ -43,7 +43,7 @@ update_key() { } main() { - cp "$THIS_DIR/nasp /etc/sudoers.d/nasp" + cp "$THIS_DIR/nasp" "/etc/sudoers.d/nasp" for file in "$THIS_DIR"/../authorized_keys/* ; do if [[ ! -d "$file" ]]; then continue diff --git a/scripts/testbed_deploy.sh b/scripts/testbed_deploy.sh index ed75701..1a77072 100755 --- a/scripts/testbed_deploy.sh +++ b/scripts/testbed_deploy.sh @@ -17,4 +17,4 @@ insert_if_not_exist() insert_if_not_exist "/etc/crontab" "*/5 * * * * cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/testbed_cron.sh" -\"$THIS_DIR\"/testbed_cron.sh +"$THIS_DIR"/testbed_cron.sh