#!/bin/bash if [[ -r /p4/common/bin/sdp_structured_log.sh ]]; then # Keep trigger/login output on the existing log while adding a JSONL # sibling. The helper is best-effort and never writes to stdout. source /p4/common/bin/sdp_structured_log.sh if [[ -n "${SDP_INSTANCE:-}" ]]; then LOGFILE="${LOGS:-/p4/${SDP_INSTANCE}/logs}/p4login.log" sdp_log_init p4login_master.sh fi fi if [[ "${SDP_SKIP_LOGIN:-0}" -eq 1 ]]; then TicketExpiration=$($P4BIN -ztag -F %TicketExpiration% -p $P4MASTERPORT -u $P4USER login -s 2>/dev/null) if [[ "$TicketExpiration" =~ [0-9]+ ]]; then exit 0 fi echo "Error: User $P4USER is not logged into $P4MASTERPORT, and SDP_SKIP_LOGIN is set (password-based login is disabled). Log in manually, e.g.: $P4BIN -p $P4MASTERPORT -u $P4USER login" > /p4/${SDP_INSTANCE}/logs/p4login.log 2>&1 exit 1 fi $P4BIN -p $P4MASTERPORT -u $P4USER login -a < /p4/common/config/.p4passwd.${P4SERVER}.admin > /p4/${SDP_INSTANCE}/logs/p4login.log 2>&1