From 48faa2bd8ae45384471b4f80c61a728765af5424 Mon Sep 17 00:00:00 2001
From: David Hoese <david.hoese@ssec.wisc.edu>
Date: Mon, 24 May 2021 11:44:34 -0500
Subject: [PATCH] Add some more error checking to ceilo driver install script
---
scripts/reinstall_ceilo_driver.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/reinstall_ceilo_driver.sh b/scripts/reinstall_ceilo_driver.sh
index 5a3145f..b05717c 100755
--- a/scripts/reinstall_ceilo_driver.sh
+++ b/scripts/reinstall_ceilo_driver.sh
@@ -4,6 +4,11 @@
# communicated with. This should be run on reboot as the driver seems to
# have trouble with kernel updates and maybe even reboots of the server.
+oops() {
+ echo "ERROR: $*"
+ exit 1
+}
+
if [ $UID -ne 0 ]; then
echo "ERROR: This script must be run as root (UID 0)."
exit 1
@@ -44,11 +49,11 @@ EOF
)
# Add the server
-cd $DRIVER_DST
+cd $DRIVER_DST || oops "Driver install directory doesn't exist"
./mxaddsvr 192.168.16.27 4
status=$?
-if [ $? -ne 0]; then
+if [ $? -ne 0 ]; then
echo "ERROR: Could not install driver"
exit 1
fi
\ No newline at end of file
--
GitLab