25 lines
1.1 KiB
Bash
25 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
#######################################################
|
|
# @description: #
|
|
# Setup the PHP session folder as a Ramdisk / tmpfs #
|
|
# This will store session info in memory #
|
|
# #
|
|
# @author: Bram Prieshof #
|
|
#######################################################
|
|
|
|
#sysCheck
|
|
if [ ! -f "/etc/WebV2/selopts.list" ] || [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
|
|
if [ ! -f "/etc/WebV2/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi
|
|
source /etc/WebV2/phpvar.list
|
|
|
|
#Stop php service
|
|
systemctl stop $phpFPMService
|
|
#Reset php session folder
|
|
rm -rf /var/lib/php/sessions
|
|
mkdir -p /var/lib/php/sessions
|
|
#Create memdisk/Tmpfs and mount it
|
|
echo "tmpfs /var/lib/php/sessions tmpfs size=32m,uid=$(id -u www-data),gid=$(id -g www-data),mode=0773 0 0" >> /etc/fstab
|
|
mount -a
|
|
#start php service
|
|
systemctl stop $phpFPMService |