mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 12:18:00 +00:00
Check to make sure libraries are installed, quit on failure
Signed-off-by: Matthew Stidham <stidmatt@protonmail.com>
This commit is contained in:
@@ -13,6 +13,28 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# scripts
|
# scripts
|
||||||
|
|
||||||
|
# Check to make sure dependencies are installed
|
||||||
|
present=(
|
||||||
|
gnuplot
|
||||||
|
wkhtmltopdf
|
||||||
|
)
|
||||||
|
killcommand=0
|
||||||
|
for i in "${present[@]}"; do
|
||||||
|
$present=$(rpm -qa | grep i)
|
||||||
|
if [[ $present -gt 0 ]]; then
|
||||||
|
pass
|
||||||
|
else
|
||||||
|
killcommand=1
|
||||||
|
echo "Please install $i on your system"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ $killcommand -gt 0 ]]; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
pass
|
||||||
|
fi
|
||||||
|
|
||||||
output_dir=diag_report
|
output_dir=diag_report
|
||||||
input_fname=
|
input_fname=
|
||||||
dut=
|
dut=
|
||||||
@@ -22,18 +44,24 @@ show_help=0
|
|||||||
while getopts "ho:f:d:C" arg; do
|
while getopts "ho:f:d:C" arg; do
|
||||||
#echo "ARG[$arg] OPTARG[$OPTARG]"
|
#echo "ARG[$arg] OPTARG[$OPTARG]"
|
||||||
case $arg in
|
case $arg in
|
||||||
o) output_dir=$OPTARG
|
o)
|
||||||
|
output_dir=$OPTARG
|
||||||
;;
|
;;
|
||||||
f) input_fname=$OPTARG
|
f)
|
||||||
|
input_fname=$OPTARG
|
||||||
;;
|
;;
|
||||||
d) dut=$OPTARG
|
d)
|
||||||
|
dut=$OPTARG
|
||||||
;;
|
;;
|
||||||
h) show_help=1
|
h)
|
||||||
|
show_help=1
|
||||||
;;
|
;;
|
||||||
C) clobber=1
|
C)
|
||||||
|
clobber=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Ignoring option $arg $OPTARG"
|
echo "Ignoring option $arg $OPTARG"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -47,11 +75,8 @@ if [ $show_help -gt 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -e $output_dir ]; then
|
||||||
if [ -e $output_dir ]
|
if [ $clobber = "1" ]; then
|
||||||
then
|
|
||||||
if [ $clobber = "1" ]
|
|
||||||
then
|
|
||||||
echo "Removing existing output directory: $output_dir"
|
echo "Removing existing output directory: $output_dir"
|
||||||
rm -fr $output_dir
|
rm -fr $output_dir
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user