Sindbad~EG File Manager
#!/usr/bin/env bash
FORCE='false'
# Just for Openresty ... should not be needed for Nginx
if test "$1" == "force"; then
FORCE='true'
fi
PHPVERSION=$(/usr/local/bin/php -v | head -n 1 | cut -d ' ' -f 2 | cut -d '.' -f -2)
if (( $(echo "$PHPVERSION >= 7.4" |bc -l) )) ; then
/usr/local/bin/php /opt/nginxhttpd/bin/console openresty:generate --force=$FORCE
else
echo "Fucked default PHP version, using lsphp instead"
/opt/alt/php74/usr/bin/php -d extension=mysqlnd.so -d extension=nd_mysqli.so -d extension=json.so -d extension=pdo.so -d extension=nd_pdo_mysql.so /opt/nginxhttpd/bin/console openresty:generate --force=$FORCE
fi
# Force = true because it will by launch every 25 minutes
if test "$FORCE" == 'true' ; then
if [[ -n $(find /etc/nginx/openresty/restrict.inc -mmin +30) ]]
then
/usr/bin/rsync -avHzWc --bwlimit=2000 pivoine.jabatus.fr::jabatus/restrict.inc /etc/nginx/openresty/restrict.inc
touch /etc/nginx/openresty/restrict.inc
fi
if [[ -n $(find /etc/nginx/openresty/blackpost.conf -mmin +30) ]]
then
/usr/bin/rsync -avHzWc --bwlimit=2000 pivoine.jabatus.fr::jabatus/blackpost.conf /etc/nginx/openresty/blackpost.conf
touch /etc/nginx/openresty/blackpost.conf
fi
if [[ -n $(find /etc/nginx/openresty/jsget.conf -mmin +30) ]]
then
/usr/bin/rsync -avHzWc --bwlimit=2000 pivoine.jabatus.fr::jabatus/jsget.conf /etc/nginx/openresty/jsget.conf
touch /etc/nginx/openresty/jsget.conf
fi
if [[ -n $(find /etc/nginx/openresty/jabatus.conf -mmin +30) ]]
then
/usr/bin/rsync -avHzWc --bwlimit=2000 pivoine.jabatus.fr::jabatus/jabatus.conf /etc/nginx/openresty/jabatus.conf
touch /etc/nginx/openresty/jabatus.conf
fi
if [[ -n $(find /etc/nginx/openresty/jabatus_wl_lua.conf -mmin +30) ]]
then
/usr/bin/rsync -avHzWc --bwlimit=2000 pivoine.jabatus.fr::jabatus/jabatus_wl_lua.conf /etc/nginx/openresty/jabatus_wl_lua.conf
touch /etc/nginx/openresty/jabatus_wl_lua.conf
fi
if [[ -n $(find /etc/nginx/openresty/whitelist_wl.conf -mmin +30) ]]
then
/usr/bin/rsync -avHzWc --bwlimit=2000 pivoine.jabatus.fr::jabatus/whitelist_wl.conf /etc/nginx/openresty/whitelist_wl.conf
touch /etc/nginx/openresty/whitelist_wl.conf
fi
if test -e /usr/bin/systemctl ; then
/usr/bin/systemctl reload openresty
else
/etc/init.d/openresty reload
fi
fi
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists