Minor tweaks

This commit is contained in:
2025-11-06 06:15:44 -05:00
parent 14b1d29384
commit c2ef3e05e3
5 changed files with 59 additions and 23 deletions

View File

@@ -2,7 +2,7 @@
#
# Oracle shell script support functions
# Written for HCL / Nokia
# v1.0 - James Pattinson - October 2025
# v1.0 - James Pattinson - November 2025
nowait=0
@@ -13,10 +13,17 @@ tabwidth=25
# Portable short hostname function
get_short_hostname() {
if hostname -s >/dev/null 2>&1; then
hostname -s
else
# Check OS type first - HP-UX hostname doesn't support -s
os_type=$(uname -s)
if [ "$os_type" = "HP-UX" ]; then
hostname | awk -F. '{print $1}'
else
# Try -s flag on other systems
if hostname -s >/dev/null 2>&1; then
hostname -s
else
hostname | awk -F. '{print $1}'
fi
fi
}
HOST=$(get_short_hostname)