]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adjusting resetdb.sh to work in production
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 01:42:09 +0000 (21:42 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 01:42:09 +0000 (21:42 -0400)
mailleur.spec.in
support/resetdb.sh

index 9d81f44aaa90f221b4ff80afd1c0eaf48f8c2c88..b01b3e5ae0280f5f24cf5d6cb4d4790b275b8156 100644 (file)
@@ -18,6 +18,7 @@ Source0               :       %{name}-@@VERSION@@.tar.gz
 BuildRequires  :       postgresql
 
 Requires       :       bash
+Requires       :       cpp
 Requires       :       dovecot
 Requires       :       openssl
 Requires       :       sed
index 5c6e4528556f5c4dd974c1847254b43932494395..aadcd2d880214a244cc2e9beeff7dc5368dcc390 100755 (executable)
@@ -18,7 +18,7 @@ if [ "$USER" != "$OWNER" ] ; then
   exit 1
   fi
 #---------------------------------------------------------------
-if [ $# -ge 1  -a  "$1" != "$DOIT" ]  ; then
+if [ $# -eq 0 -o $# -ge 1  -a  "$1" != "$DOIT" ]  ; then
   echo ""
   echo "-----------"
   echo "ATTENTION! you are requesting a FULL database RESET"
@@ -27,7 +27,7 @@ if [ $# -ge 1  -a  "$1" != "$DOIT" ]  ; then
   echo "-----------"
   sleep $DELAY
   fi
-if [ $1 == $DOIT ]  ; then
+if [ -n "$1" -a "$1" == "$DOIT" ]  ; then
   shift;
   fi
 CONF=/etc/$APPLICATION/$APPLICATION.conf