[dev] first working version #4

Merged
DictXiong merged 21 commits from dev into main 2023-05-30 13:21:29 +08:00
3 changed files with 4 additions and 4 deletions
Showing only changes of commit 9fa560e5c2 - Show all commits

View File

@ -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" 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

View File

@ -7,7 +7,7 @@ touch_user() {
if id -u $1 1>/dev/null 2>&1; then if id -u $1 1>/dev/null 2>&1; then
return return
fi fi
if ! id -g nasp 1>/dev/null 2>&1; then if ! getent group nasp ; then
echo "Group 'nasp' does not exist\!" echo "Group 'nasp' does not exist\!"
exit 1 exit 1
fi fi
@ -43,7 +43,7 @@ update_key() {
} }
main() { 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 for file in "$THIS_DIR"/../authorized_keys/* ; do
if [[ ! -d "$file" ]]; then if [[ ! -d "$file" ]]; then
continue continue

View File

@ -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" 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