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
28 PARSED_ARGUMENTS=$(getopt -o h:p:s: -- "$@")
30 if [ "$VALID_ARGUMENTS" != "0" ]; then
31 echo $0: usage: $0 '[-h data_directory] [-p http_port] [-s https_port] command'
32 echo 'command must be one of: run, test, install'
35 eval set -- ${PARSED_ARGUMENTS}
39 -h) CTDL_DIR=${2} ; shift 2 ;;
40 -p) HTTP_PORT=${2} ; shift 2 ;;
41 -s) HTTPS_PORT=${2} ; shift 2 ;;
43 *) echo Unexpected option: ${1}
50 export APPDIR CTDL_DIR HTTP_PORT HTTPS_PORT
51 export LD_LIBRARY_PATH=$APPDIR/usr/lib
52 export PATH=$APPDIR/usr/bin
56 export LD_LIBRARY_PATH=$APPDIR/usr/lib
57 export PATH=$APPDIR/usr/bin
58 $APPDIR/usr/local/citadel/citserver -c
62 echo Unexpected command: ${1}
72 # This unit file starts all Citadel services via the AppImage distribution.
77 ExecStart=/root/citadel/appimage/Citadel-x86_64.AppImage run -h /usr/local/citadel -s 80 -s 443
78 ExecStop=/bin/kill $MAINPID
83 WantedBy=multi-user.target