#!/bin/bash
set -u
# This is the cheater's trick to get the AWS EC2 Instance ID.
EC2_InstanceID=$(readlink /var/lib/cloud/instance)
EC2_InstanceID=${EC2_InstanceID##*/}
[[ -n "$EC2_InstanceID" ]] && echo "$EC2_InstanceID"
# For reference, this is a more "official" way to get an AWS EC2 Instance ID.
### TOKEN=$(curl -sS -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") 2>/dev/null
### EC2_InstanceID=$(curl -sS -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id)
### echo "$EC2_InstanceID"
# Tip: The /var/lib/cloud/instances directory does not get cleaned up during AMI
# create/restore process. It can contain multiple obsolete instance IDs.
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #1 | 32803 | Russell C. Jackson (Rusty) |
Modernize russell_jackson SDP fork from upstream 2025.2. - Port modern p4d features: partitioned/readonly clients, upgrade-safety (p4 storage -w / p4 upgrades polling), checkpoint/replica/edge tooling, proxy & broker SSL trust, modern p4login, dir-ownership preflight. - Add scripts: get_p4_binaries.sh (renamed from helix), ccheck.sh, verify_sdp.sh, sdp_health_check.sh, journal_watch.sh, load_checkpoint.sh, refresh_P4ROOT, request_replica_checkpoint.sh, keep_offline_db_current.sh, gen_sudoers.sh, etc. - Migrate configurables to configurables.cfg applied via ccheck.sh -fix; slim configure_new_server.sh to setup-only. - upgrade.sh: dry-run default, verified clean rollback point. - Fixes from multi-agent review (rsync byte/KB+comma, cfg field counts, version thresholds, etc.). See SDP_PORT_SCOPE.md for the full manifest. |