Skip to content

Commit

Permalink
Add better solaris support to support script (#263)
Browse files Browse the repository at this point in the history
* Add better solaris support to support script

* Redirect all type output
  • Loading branch information
mbish authored Sep 28, 2023
1 parent 3e2a0ec commit 7a4e25c
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions duo_unix_support/duo_unix_support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,28 @@ else
echo "Could not find version of Duo Unix (login_duo was not found)" > configuration.txt
fi

if [ "$OS" = "solaris" ]; then
if type ggrep &>/dev/null; then
GREP=ggrep
fi
else
GREP=grep
fi

echo "operating_system=${OS}" >> configuration.txt
echo "version=${VER}" >> configuration.txt
echo "kernel=${KERNEL}" >> configuration.txt
echo "openssl_version=${OPENSSL_VER}" >> configuration.txt
echo "ssh=$(ssh -V 2>&1)" &>> configuration.txt
echo -e "\nGathering logs and pam configs"
# Check if the user has gcc and make
if type gcc >/dev/null; then
if type gcc &>/dev/null; then
GCC_VER=$(gcc --version)
echo "gcc=$GCC_VER" | grep "gcc" >> configuration.txt
echo "gcc=$GCC_VER" | $GREP "gcc" >> configuration.txt
fi
if type make >/dev/null; then
if type make &>/dev/null; then
MAKE_VER=$(make --version)
echo "make=$MAKE_VER" | grep "make" >> configuration.txt
echo "make=$MAKE_VER" | $GREP "make" >> configuration.txt
fi

# Copy over common configurations and scrub the skey from the configs
Expand Down Expand Up @@ -176,8 +184,14 @@ COPY_FILES=(
"/var/log/messages"
"/var/log/secure"
"/var/log/syslog"
"/var/adm/messages"
"/var/adm/messages.0"
)

PAM_DUO_FILES=$($GREP -ilr "pam_duo.so" "/etc/pam.d")
# There might be duplicates but that's fine
COPY_FILES+=(${PAM_DUO_FILES[@]})

for path in "${COPY_FILES[@]}"
do
check_and_cp $path
Expand Down

0 comments on commit 7a4e25c

Please sign in to comment.