From 8db8a2290683acf94f02e855af668a864d6001c2 Mon Sep 17 00:00:00 2001 From: Nina Didenko Date: Wed, 20 Nov 2019 22:50:06 +0300 Subject: [PATCH] installCDE: don't hardcode path to whoami Hi. Patch removes hardcoded paths to echo and whoami in installation scripts. Thanks. --- cde/admin/IntegTools/dbTools/installCDE.src | 11 ++--------- cde/admin/IntegTools/dbTools/mkProd | 9 +-------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/cde/admin/IntegTools/dbTools/installCDE.src b/cde/admin/IntegTools/dbTools/installCDE.src index a00fefd1..233b4a96 100755 --- a/cde/admin/IntegTools/dbTools/installCDE.src +++ b/cde/admin/IntegTools/dbTools/installCDE.src @@ -52,7 +52,7 @@ LOGFILE="installCDE.$$.log" Log() { - /bin/echo "$1" | tee -a $LOGFILE + echo "$1" | tee -a $LOGFILE } MakeTarball() @@ -537,14 +537,7 @@ XCOMM PLATFORM_SCRIPT_DIR=hp fi - if [ "$PLATFORM" = "aix" ]; - then - USER=$(/bin/whoami) - else - USER=$(/usr/bin/whoami) - fi - - if [ "$USER" != "root" ]; + if [ $(whoami) != "root" ]; then echo "" echo "You should be root to run this script. Continuing anyway." diff --git a/cde/admin/IntegTools/dbTools/mkProd b/cde/admin/IntegTools/dbTools/mkProd index 44591fab..413a77e8 100755 --- a/cde/admin/IntegTools/dbTools/mkProd +++ b/cde/admin/IntegTools/dbTools/mkProd @@ -96,13 +96,6 @@ else # Build system = HP PLATFORM=hp-ux fi -if [ $PLATFORM = "aix" ]; -then - USER=`/bin/whoami` -else - USER=`/usr/bin/whoami` -fi - awkit() { awk ' BEGIN { @@ -504,7 +497,7 @@ doit() } # set permissions for non-links if [ "${TYPE%link}" = "$TYPE" ]; then - if [ "$USER" = "root" ]; then + if [ $(whoami) = "root" ]; then chgrp $GROUP $DEST || echo "ERROR: \"chgrp $GROUP $DEST\" failed" >&2 chown $OWNER $DEST || -- 2.25.1