Skip to content

Commit

Permalink
Add better solaris support to support script
Browse files Browse the repository at this point in the history
  • Loading branch information
mbish committed Sep 26, 2023
1 parent 3e2a0ec commit 927c5ff
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions duo_unix_support/duo_unix_support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ 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
Expand All @@ -121,11 +129,11 @@ echo -e "\nGathering logs and pam configs"
# Check if the user has gcc and make
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
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 927c5ff

Please sign in to comment.