hpux updates

This commit is contained in:
2025-10-24 12:39:08 -04:00
parent 1dce024cd8
commit ab2e15d717
5 changed files with 134 additions and 85 deletions

View File

@@ -10,7 +10,17 @@
# -v Volume to operate on, logs or data
# -o Operation to perform - open or close the MV
MYDIR="$(dirname "$(readlink -f "$0")")"
get_script_dir() {
# Portable way to get script directory for Linux and HP/UX
local src="$0"
while [ -h "$src" ]; do
dir="$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)"
src="$(readlink "$src")"
[[ $src != /* ]] && src="$dir/$src"
done
cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd
}
MYDIR="$(get_script_dir)"
source $MYDIR/rbk_api.conf
source $MYDIR/oracle_funcs.sh
@@ -42,7 +52,14 @@ fi
# Script starts here
mv_name=$(hostname -s)_${DBNAME}_${VOLUME}
get_short_hostname() {
if hostname -s >/dev/null 2>&1; then
hostname -s
else
hostname | awk -F. '{print $1}'
fi
}
mv_name=$(get_short_hostname)_${DBNAME}_${VOLUME}
get_mv
case $OPCODE in