From: Art Cancro Date: Thu, 1 Apr 2021 19:50:01 +0000 (-0400) Subject: Added 'database_cleanup' to the AppImage X-Git-Tag: v939~77 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=55a6d74dded2e0472732b248fba548f611f2a7aa Added 'database_cleanup' to the AppImage --- diff --git a/appimage/citadel.AppDir/AppRun b/appimage/citadel.AppDir/AppRun index 252056079..ff2fe0e61 100755 --- a/appimage/citadel.AppDir/AppRun +++ b/appimage/citadel.AppDir/AppRun @@ -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 diff --git a/citadel/database_cleanup.sh b/citadel/database_cleanup.sh index c35527497..81b395ec9 100755 --- a/citadel/database_cleanup.sh +++ b/citadel/database_cleanup.sh @@ -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