#!/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 | 27722 | C. Thomas Tyler |
Refinements to @27712: * Resolved one out-of-date file (verify_sdp.sh). * Added missing adoc file for which HTML file had a change (WorkflowEnforcementTriggers.adoc). * Updated revdate/revnumber in *.adoc files. * Additional content updates in Server/Unix/p4/common/etc/cron.d/ReadMe.md. * Bumped version numbers on scripts with Version= def'n. * Generated HTML, PDF, and doc/gen files: - Most HTML and all PDF are generated using Makefiles that call an AsciiDoc utility. - HTML for Perl scripts is generated with pod2html. - doc/gen/*.man.txt files are generated with .../tools/gen_script_man_pages.sh. #review-27712 |
||
#1 | 26652 | Robert Cowham |
This is Tom's change: Introduced new 'Unsupported' directory to clarify that some files in the SDP are not officially supported. These files are samples for illustration, to provide examples, or are deprecated but not yet ready for removal from the package. The Maintenance and many SDP triggers have been moved under here, along with other SDP scripts and triggers. Added comments to p4_vars indicating that it should not be edited directly. Added reference to an optional site_global_vars file that, if it exists, will be sourced to provide global user settings without needing to edit p4_vars. As an exception to the refactoring, the totalusers.py Maintenance script will be moved to indicate that it is supported. Removed settings to support long-sunset P4Web from supported structure. Structure under new .../Unsupported folder is: Samples/bin Sample scripts. Samples/triggers Sample trigger scripts. Samples/triggers/tests Sample trigger script tests. Samples/broker Sample broker filter scripts. Deprecated/triggers Deprecated triggers. To Do in a subsequent change: Make corresponding doc changes. |
||
//guest/perforce_software/sdp/dev/Maintenance/license_status_check.sh | |||||
#1 | 23284 | C. Thomas Tyler | Added Helix Core license status check script. |