From 2f8c7c47810173d6afdc75f7b8960ea4f09af278 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Thu, 14 Mar 2024 15:22:09 -0700 Subject: [PATCH] check for dpkg lock, note about mail server --- install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 071f92c..9a23300 100644 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ # require root if [ "${EUID}" -ne 0 ]; then - echo "This script must be run as root" + echo "This script must be run as root." exit 1 fi @@ -17,7 +17,14 @@ fi os_id=`lsb_release -is` os_release=`lsb_release -rs` if [ $os_id != Ubuntu ] || [ $os_release != 22.04 ]; then - echo "this installer only runs on Ubuntu 22.04, bailing out" + echo "This installer only runs on Ubuntu 22.04, bailing out." + exit 1 +fi + +if lsof /var/lib/dpkg/lock-frontend ; then + echo "Could not get lock /var/lib/dpkg/lock-frontend" + echo "See output above for info on what is holding the lock." + echo "What for the command above to complete, then re-run this script." exit 1 fi @@ -132,3 +139,4 @@ cp sbin/* /usr/local/sbin/ echo "" echo "Unattended upgrades & fail2ban are configured to send notifications to $WEBMASTER." echo "Update /etc/apt/apt.conf.d/50unattended-upgrades and /etc/fail2ban/jail.local to suit your needs." +echo "NOTE: No mail server has been installed and emails won't send without one. See the README for more info."