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
24 echo ${APPIMAGE}: usage: ${APPIMAGE} '[-h data_directory] [-p http_port] [-s https_port] command'
25 echo 'command must be one of: run, test, install'
30 # Permanently install the Citadel AppImage to this system
33 # First ... check to make sure Citadel isn't runnings
34 if ps ax | grep citserver | grep -v grep ; then
35 echo Installation cannot proceed while Citadel is running.
36 echo Stop your services and try again.
45 PARSED_ARGUMENTS=$(getopt -o h:p:s: -- "$@")
47 if [ "$VALID_ARGUMENTS" != "0" ]; then
51 eval set -- ${PARSED_ARGUMENTS}
55 -h) CTDL_DIR=${2} ; shift 2 ;;
56 -p) HTTP_PORT=${2} ; shift 2 ;;
57 -s) HTTPS_PORT=${2} ; shift 2 ;;
59 *) echo Unexpected option: ${1}
66 export APPDIR CTDL_DIR HTTP_PORT HTTPS_PORT
67 export LD_LIBRARY_PATH=$APPDIR/usr/lib
68 export PATH=$APPDIR/usr/bin
72 export LD_LIBRARY_PATH=$APPDIR/usr/lib
73 export PATH=$APPDIR/usr/bin
74 exec $APPDIR/usr/local/citadel/citserver -c
80 echo Unexpected command: ${1}
90 # This unit file starts all Citadel services via the AppImage distribution.
95 ExecStart=/root/citadel/appimage/Citadel-x86_64.AppImage run -h /usr/local/citadel -s 80 -s 443
96 ExecStop=/bin/kill $MAINPID
101 WantedBy=multi-user.target