#!/bin/bash set -u function msg () { echo -e "$*"; } function bail () { msg "\nError: ${1:-Unknown Error}\n"; exit ${2:-1}; } export SDP_INSTANCE=${SDP_INSTANCE:-Undefined} export SDP_INSTANCE=${1:-$SDP_INSTANCE} [[ $SDP_INSTANCE == Undefined ]] && bail "\nUsage: ${0##*/} [SDP_INSTANCE] Provide an SDP_INSTANCE value (e.g. '1') as a paramter to this script, or use it when setting the SDP environment by running: source /p4/common/bin/p4_vars 1\n" source /p4/common/bin/p4_vars "$SDP_INSTANCE" IsLicensed=$($P4BIN -F %isLicensed% license -u) if [[ $IsLicensed == yes ]]; then LicenseTimeRemaining=$($P4BIN -F %licenseTimeRemaining% license -u) if [[ -n "$LicenseTimeRemaining" ]]; then msg "License Time Remaining $((LicenseTimeRemaining/86400)) days $((LicenseTimeRemaining/3600%24)) hours $((LicenseTimeRemaining%3600/60)) minutes $((LicenseTimeRemaining%60)) seconds.\n" else bail "Could not determine licence time remaining. A call to '$P4BIN license -u' did not provide a valid response." fi else msg "This server is not licensed." fi
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 27331 | C. Thomas Tyler |
Released SDP 2020.1.27325 (2021/01/29). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#1 | 23331 | C. Thomas Tyler |
Released SDP 2017.4.23329 (2017/12/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
//guest/perforce_software/sdp/dev/Maintenance/license_status_check.sh | |||||
#1 | 23284 | C. Thomas Tyler | Added Helix Core license status check script. |