Skip to content
Permalink
Browse files

Add nouserinput flag to dev detect

  • Loading branch information...
tatokis authored and ZirconiumX committed Jun 17, 2018
1 parent bf487e7 commit d9e7074d8a12e6760c5314da73b0afd6fcef4402
Showing with 12 additions and 7 deletions.
  1. +12 −7 ckb-next-dev-detect
@@ -3,19 +3,24 @@
# Newline
N=$'\n'

echo "This script will collect information about the Corsair devices in your system."
read -p "Please make sure they are plugged in and press Enter.${N}"
if [[ "$1" != "--nouserinput" ]]; then
OUTPATH="${PWD}/"
echo "This script will collect information about the Corsair devices in your system."
read -p "Please make sure they are plugged in and press Enter.${N}"
else
OUTPATH="/tmp/"
fi

# Force English
export LC_ALL=C

#Check if user can write to the PWD
touch ckb-next-dev-detect-report.gz
touch "${OUTPATH}ckb-next-dev-detect-report.gz"
TOUCHRET=$?
if [ $TOUCHRET -ne 0 ]; then
echo "Could not write the report to disk, make sure this user can write to ${PWD}/"
echo "Could not write the report to disk, make sure this user can write to ${OUTPATH}"
echo "Retval: $TOUCHRET"
exit
exit $TOUCHRET
fi

OUT="ckb-next-dev-detect - $(date)"
@@ -49,7 +54,7 @@ else
fi

# Gzip and write output
echo "$OUT" | gzip > ckb-next-dev-detect-report.gz
echo "$OUT" | gzip > "${OUTPATH}ckb-next-dev-detect-report.gz"

echo "Done! Please send the following report to the developers."
echo "Location: ${PWD}/ckb-next-dev-detect-report.gz"
echo "Location: ${OUTPATH}ckb-next-dev-detect-report.gz"

0 comments on commit d9e7074

Please sign in to comment.
You can’t perform that action at this time.