Fix rights, add confs apache, add prototype of systemd confs, add scripts to start and stop raspisms
This commit is contained in:
parent
aa3189bfaa
commit
89d786a730
|
@ -1,2 +1,3 @@
|
|||
RewriteEngine on
|
||||
RewriteRule !\.(js|ico|ICO|gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG|css|woff|woff2|ttf|wav|ogg|mp3)$ index.php
|
||||
RewriteBase "/raspisms/"
|
||||
RewriteRule "!\.(js|ico|ICO|gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG|css|woff|woff2|ttf|wav|ogg|mp3)$" index.php
|
||||
|
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Script to start RaspiSMS daemons
|
||||
#
|
||||
PID_DIR="/var/run/raspisms/"
|
||||
LOG_FILE="/var/log/raspisms.log"
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
RASPISMS_DIR=$(readlink -f "${SCRIPT%/*}/../")
|
||||
CONSOLE_PATH="$RASPISMS_DIR/console.php"
|
||||
COMMAND="php $CONSOLE_PATH controllers/internals/Console.php launcher"
|
||||
|
||||
#Create PID DIR IF NOT EXISTS
|
||||
if [ ! -d $PID_DIR ]
|
||||
then
|
||||
mkdir $PID_DIR
|
||||
fi
|
||||
|
||||
#Create log file if not exists
|
||||
if [ ! -f $LOG_FILE ]
|
||||
then
|
||||
touch $LOG_FILE
|
||||
chmod 777 $LOG_FILE
|
||||
fi
|
||||
|
||||
#Run command to start daemons
|
||||
$COMMAND
|
||||
exit $?
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Script to stop RaspiSMS daemons
|
||||
#
|
||||
PID_DIR="/var/run/raspisms"
|
||||
DAEMON_LAUNCHER_PID_FILE="/var/run/raspisms/RaspiSMS Daemon Launcher.pid"
|
||||
PID_FILES=$PID_DIR/*.pid
|
||||
|
||||
|
||||
kill_process()
|
||||
{
|
||||
local PID=$1
|
||||
kill "$PID"
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
#Kill daemon launcher if available
|
||||
if [ -f "$DAEMON_LAUNCHER_PID_FILE" ]
|
||||
then
|
||||
printf "Stop RaspiSMS daemon Launcher..."
|
||||
PID=$(cat "$DAEMON_LAUNCHER_PID_FILE")
|
||||
$(kill_process "$PID")
|
||||
RETURN=$?
|
||||
|
||||
if [ $RETURN -eq 0 ]
|
||||
then
|
||||
printf "success.\n"
|
||||
else
|
||||
printf "failed.\n"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
|
||||
printf "Stop RaspiSMS remaining daemons..."
|
||||
for f in $PID_FILES
|
||||
do
|
||||
[ -f "$f" ] || continue #Bypass no real file return on empty dir
|
||||
|
||||
printf "."
|
||||
PID=$(cat "$f")
|
||||
kill_process "$PID"
|
||||
done
|
||||
printf "Done.\n"
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=RaspiSMS Daemons
|
||||
Documentation=https://raspisms.raspberry-pi.fr
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/var/run/raspisms/RaspiSMS Daemon Launcher.pid
|
||||
ExecStart=/opt/raspisms/bin/start.sh
|
||||
ExecStop=/opt/raspisms/bin/start.sh
|
||||
WorkingDirectory=/opt/raspisms
|
||||
Restart=on-failure
|
|
@ -0,0 +1,4 @@
|
|||
<LocationMatch "^/raspisms">
|
||||
Options +FollowSymLinks
|
||||
AllowOverride All
|
||||
</LocationMatch>
|
|
@ -4,7 +4,7 @@
|
|||
/*
|
||||
* Define Descartes env
|
||||
*/
|
||||
$http_dir_path = ''; //Path we need to put after servername in url to access app
|
||||
$http_dir_path = '/raspisms'; //Path we need to put after servername in url to access app
|
||||
$http_protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
|
||||
$http_server_name = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost';
|
||||
$http_server_port = isset($_SERVER['SERVER_PORT']) ? ($_SERVER['SERVER_PORT'] == 80) ? '' : ':' . $_SERVER['SERVER_PORT'] : '';
|
||||
|
|
Loading…
Reference in New Issue