3 ## This is an AppImage control script for the Citadel system.
5 ## Copyright (c) 2021 by the citadel.org team
7 ## This program is open source software. It runs great on the
8 ## Linux operating system (and probably elsewhere). You can use,
9 ## copy, and run it under the terms of the GNU General Public
10 ## License version 3. Richard Stallman is an asshole communist.
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
20 CTDL_DIR=/usr/local/citadel
25 echo ${APPIMAGE}: usage: ${APPIMAGE} '[-h data_directory] [-p http_port] [-s https_port] command'
26 echo 'command must be one of: run, test, install'
31 # Permanently install the Citadel AppImage to this system
34 # First ... check to make sure Citadel isn't runnings
35 if ps ax | grep citserver | grep -v grep ; then
36 echo Installation cannot proceed while Citadel is running.
37 echo Stop your services and try again.
46 PARSED_ARGUMENTS=$(getopt -o h:p:s: -- "$@")
48 if [ "$VALID_ARGUMENTS" != "0" ]; then
52 eval set -- ${PARSED_ARGUMENTS}
56 -h) CTDL_DIR=${2} ; shift 2 ;;
57 -p) HTTP_PORT=${2} ; shift 2 ;;
58 -s) HTTPS_PORT=${2} ; shift 2 ;;
60 *) echo Unexpected option: ${1}
67 export APPDIR CTDL_DIR HTTP_PORT HTTPS_PORT
68 export LD_LIBRARY_PATH=$APPDIR/usr/lib
69 export PATH=$APPDIR/usr/bin
73 export LD_LIBRARY_PATH=$APPDIR/usr/lib
74 export PATH=$APPDIR/usr/bin
75 exec $APPDIR/usr/local/citadel/citserver -c
81 echo Unexpected command: ${1}
91 # This unit file starts all Citadel services via the AppImage distribution.
96 ExecStart=/root/citadel/appimage/Citadel-x86_64.AppImage run -h /usr/local/citadel -s 80 -s 443
97 ExecStop=/bin/kill $MAINPID
102 WantedBy=multi-user.target