Skip to content

Commit 6e97556

Browse files
committed
fix basename typo
1 parent 1b5149c commit 6e97556

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

bin/ghe-restore

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ log_warn "Warning: storing backup-utils version remotely failed."
388388
# Stop cron and timerd, as scheduled jobs may disrupt the restore process.
389389
log_info "Stopping cron and github-timerd ..."
390390
if $CLUSTER; then
391-
bm_start "basename($0) - Stopping cron and github-timerd on cluster"
391+
bm_start "$(basename $0) - Stopping cron and github-timerd on cluster"
392392
if ! ghe-ssh "$GHE_HOSTNAME" -- "ghe-cluster-each -- sudo service cron stop"; then
393393
log_warn "Failed to stop cron on one or more nodes" 1>&3
394394
fi
@@ -420,7 +420,7 @@ else
420420
log_warn "Failed to stop github-timerd" 1>&3
421421
fi
422422
fi
423-
bm_end "basename($0) - Stopping cron and github-timerd on cluster"
423+
bm_end "$(basename $0) - Stopping cron and github-timerd on cluster"
424424
fi
425425
CRON_RUNNING=false
426426

@@ -442,12 +442,12 @@ fi
442442
# Restore UUID if present and not restoring to cluster.
443443
if [ -s "$GHE_RESTORE_SNAPSHOT_PATH/uuid" ] && ! $CLUSTER; then
444444
log_info "Restoring UUID ..."
445-
bm_start "basename($0) - Restore UUID"
445+
bm_start "$(basename $0) - Restore UUID"
446446
cat "$GHE_RESTORE_SNAPSHOT_PATH/uuid" |
447447
ghe-ssh "$GHE_HOSTNAME" -- "sudo sponge '$GHE_REMOTE_DATA_USER_DIR/common/uuid' 2>/dev/null"
448448
ghe-ssh "$GHE_HOSTNAME" -- "sudo systemctl stop consul" || true
449449
ghe-ssh "$GHE_HOSTNAME" -- "sudo rm -rf /data/user/consul/raft"
450-
bm_end "basename($0) - Restore UUID"
450+
bm_end "$(basename $0) - Restore UUID"
451451
fi
452452

453453
if is_external_database_snapshot; then
@@ -498,9 +498,9 @@ fi
498498
cmd_title=$(log_info "Restoring Redis database ...")
499499
commands=("
500500
echo \"$cmd_title\"
501-
bm_start \"basename($0) - Restoring Redis\"
501+
bm_start \"$(basename $0) - Restoring Redis\"
502502
ghe-ssh \"$GHE_HOSTNAME\" -- 'ghe-import-redis' < \"$GHE_RESTORE_SNAPSHOT_PATH/redis.rdb\" 1>&3
503-
bm_end \"basename($0) - Restoring Redis\"")
503+
bm_end \"$(basename $0) - Restoring Redis\"")
504504

505505
cmd_title=$(log_info "Restoring Git Repositories ...")
506506
commands+=("
@@ -520,9 +520,9 @@ ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
520520
cmd_title=$(log_info "Restoring SSH authorized keys ...")
521521
commands+=("
522522
echo \"$cmd_title\"
523-
bm_start \"basename($0) -Restoring SSH authorized keys\"
523+
bm_start \"$(basename $0) -Restoring SSH authorized keys\"
524524
ghe-ssh \"$GHE_HOSTNAME\" -- 'ghe-import-authorized-keys' < \"$GHE_RESTORE_SNAPSHOT_PATH/authorized-keys.json\" 1>&3
525-
bm_end \"basename($0) -Restoring SSH authorized keys\"")
525+
bm_end \"$(basename $0) -Restoring SSH authorized keys\"")
526526

527527
cmd_title=$(log_info "Restoring storage data ...")
528528
commands+=("
@@ -575,10 +575,10 @@ fi
575575

576576
# Restart an already running memcached to reset the cache after restore
577577
log_info "Restarting memcached ..." 1>&3
578-
bm_start "basename($0) - Restarting memcached"
578+
bm_start "$(basename $0) - Restarting memcached"
579579
echo "sudo restart -q memcached 2>/dev/null || true" |
580580
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh
581-
bm_end "basename($0) - Restarting memcached"
581+
bm_end "$(basename $0) - Restarting memcached"
582582

583583
# Prevent GitHub Connect jobs running before we've had a chance to reset
584584
# the configuration by setting the last run date to now.
@@ -592,7 +592,7 @@ fi
592592
# config run to perform data migrations.
593593
if $CLUSTER; then
594594
log_info "Configuring cluster ..."
595-
bm_start "basename($0) - configure cluster"
595+
bm_start "$(basename $0) - configure cluster"
596596
if [ "$GHE_VERSION_MAJOR" -eq "3" ]; then
597597
ghe-ssh "$GHE_HOSTNAME" -- "ghe-cluster-nomad-cleanup" 1>&3 2>&3
598598
elif [ "$GHE_VERSION_MAJOR" -eq "2" ] && [ "$GHE_VERSION_MINOR" -eq "22" ]; then
@@ -609,7 +609,7 @@ elif $instance_configured; then
609609
ghe-ssh "$GHE_HOSTNAME" -- "/usr/local/share/enterprise/ghe-nomad-cleanup" 1>&3 2>&3
610610
fi
611611
ghe-ssh "$GHE_HOSTNAME" -- "ghe-config-apply" 1>&3 2>&3
612-
bm_end "basename($0) - configure cluster"
612+
bm_end "$(basename $0) - configure cluster"
613613
fi
614614

615615
# Clear GitHub Connect settings stored in the restored database.
@@ -627,7 +627,7 @@ CRON_RUNNING=true
627627
# Clean up all stale replicas on configured instances.
628628
if ! $CLUSTER && $instance_configured; then
629629
log_info "Cleaning up replicas..." 1>&3
630-
bm_start "basename($0) - Cleanup replicas"
630+
bm_start "$(basename $0) - Cleanup replicas"
631631
restored_uuid=$(cat $GHE_RESTORE_SNAPSHOT_PATH/uuid)
632632
other_nodes=$(echo "
633633
set -o pipefail; \
@@ -643,7 +643,7 @@ if ! $CLUSTER && $instance_configured; then
643643
echo "set -o pipefail; $(typeset -f cleanup_cluster_nodes); cleanup_cluster_nodes $uuid" | ghe-ssh "$GHE_HOSTNAME" 1>&3
644644
done
645645
fi
646-
bm_end "basename($0) - Cleanup replicas"
646+
bm_end "$(basename $0) - Cleanup replicas"
647647
fi
648648

649649
# Update the remote status to "complete". This has to happen before importing

0 commit comments

Comments
 (0)