Minor tweaks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user