Skip to content

Commit

Permalink
scripts UPDATE use command instead of which
Browse files Browse the repository at this point in the history
Fixes #1082
  • Loading branch information
michalvasko committed Nov 26, 2021
1 parent e34c5df commit e6cdbb9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/merge_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ if [ -n "$SYSREPOCFG_EXECUTABLE" ]; then
SYSREPOCFG="$SYSREPOCFG_EXECUTABLE"
# avoid problems with sudo PATH
elif [ `id -u` -eq 0 ]; then
SYSREPOCFG=`su -c 'which sysrepocfg' -l $USER`
SYSREPOCFG=`su -c 'command -v sysrepocfg' -l $USER`
else
SYSREPOCFG=`which sysrepocfg`
SYSREPOCFG=`command -v sysrepocfg`
fi
KS_KEY_NAME=genkey

Expand Down
8 changes: 4 additions & 4 deletions scripts/merge_hostkey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ if [ -n "$SYSREPOCFG_EXECUTABLE" ]; then
SYSREPOCFG="$SYSREPOCFG_EXECUTABLE"
# avoid problems with sudo PATH
elif [ `id -u` -eq 0 ]; then
SYSREPOCFG=`su -c 'which sysrepocfg' -l $USER`
SYSREPOCFG=`su -c 'command -v sysrepocfg' -l $USER`
else
SYSREPOCFG=`which sysrepocfg`
SYSREPOCFG=`command -v sysrepocfg`
fi

if [ -n "$OPENSSL_EXECUTABLE" ]; then
OPENSSL="$OPENSSL_EXECUTABLE"
elif [ `id -u` -eq 0 ]; then
OPENSSL=`su -c 'which openssl' -l $USER`
OPENSSL=`su -c 'command -v openssl' -l $USER`
else
OPENSSL=`which openssl`
OPENSSL=`command -v openssl`
fi

# check that there is no SSH key with this name yet
Expand Down
4 changes: 2 additions & 2 deletions scripts/remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ if [ -n "$SYSREPOCTL_EXECUTABLE" ]; then
SYSREPOCTL="$SYSREPOCTL_EXECUTABLE"
# avoid problems with sudo PATH
elif [ `id -u` -eq 0 ]; then
SYSREPOCTL=`su -c 'which sysrepoctl' -l $USER`
SYSREPOCTL=`su -c 'command -v sysrepoctl' -l $USER`
else
SYSREPOCTL=`which sysrepoctl`
SYSREPOCTL=`command -v sysrepoctl`
fi

# array of modules to remove, exact same as setup.sh
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ if [ -n "$SYSREPOCTL_EXECUTABLE" ]; then
SYSREPOCTL="$SYSREPOCTL_EXECUTABLE"
# avoid problems with sudo PATH
elif [ `id -u` -eq 0 ]; then
SYSREPOCTL=`su -c 'which sysrepoctl' -l $USER`
SYSREPOCTL=`su -c 'command -v sysrepoctl' -l $USER`
else
SYSREPOCTL=`which sysrepoctl`
SYSREPOCTL=`command -v sysrepoctl`
fi
MODDIR=${DESTDIR}${NP2_MODULE_DIR}
PERMS=${NP2_MODULE_PERMS}
Expand Down

0 comments on commit e6cdbb9

Please sign in to comment.