Added 'database_cleanup' to the AppImage
authorArt Cancro <ajc@citadel.org>
Thu, 1 Apr 2021 19:50:01 +0000 (15:50 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 1 Apr 2021 19:50:01 +0000 (15:50 -0400)
appimage/citadel.AppDir/AppRun
citadel/database_cleanup.sh

index 25205607933ea3626ff1cffa600be0fe5405160b..ff2fe0e61980284f2d32fb5952538c58ac71a395 100755 (executable)
@@ -1,18 +1,18 @@
 #!/bin/bash
 
-## This is an AppImage control script for the Citadel system.
-##
-## Copyright (c) 2021 by the citadel.org team
-##
-## This program is open source software.  It runs great on the
-## Linux operating system (and probably elsewhere).  You can use,
-## copy, and run it under the terms of the GNU General Public
-## License version 3.  Richard Stallman is an asshole communist.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU General Public License for more details.
+# This is an AppImage control script for the Citadel system.
+#
+# Copyright (c) 2021 by the citadel.org team
+#
+# This program is open source software.  It runs great on the
+# Linux operating system (and probably elsewhere).  You can use,
+# copy, and run it under the terms of the GNU General Public
+# License version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 
 # Default values
 HTTP_PORT=80
@@ -23,7 +23,7 @@ ulimit -c unlimited
 
 usage() {
        echo ${APPIMAGE}: usage: ${APPIMAGE} '[-h data_directory] [-p http_port] [-s https_port] command'
-       echo 'command must be one of: run, test, install'
+       echo 'command must be one of: run, test, install, database_cleanup'
        exit 2
 }
 
@@ -194,6 +194,11 @@ case ${1} in
        install)
                installation
                ;;
+       database_cleanup)
+               export LD_LIBRARY_PATH=$APPDIR/usr/lib
+               export PATH=$APPDIR/usr/bin:$PATH
+               exec $APPDIR/usr/local/citadel/database_cleanup.sh -h $CTDL_DIR
+               ;;
        *)
                echo Unexpected command: ${1} 
                usage
index c355274972971cfa914a6d89149bd27c6f8889a5..81b395ec9f686869c3ec9b16bb746cc60bd8dae2 100755 (executable)
@@ -140,11 +140,11 @@ do
                echo error $?
                die
        }
-       rm -f $DATA_DIR/$filename
+       rm -vf $DATA_DIR/$filename
 done
 
 echo Removing old databases
-rm -f ./data/*
+rm -vf $DATA_DIR/*
 
 for x in 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d
 do