| Server IP : 118.27.122.248 / Your IP : 216.73.217.142 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/jp-secure/siteguardlite/ |
Upload File : |
#!/bin/bash
#
# rc.siteguardlite_http
# - web server control for SiteGuard Lite
#
# chkconfig: - 99 01
# description: SiteGuard Lite
#
# For Turbolinux ES8(UnitedLinux)
### BEGIN INIT INFO
# Provides: siteguardlite_notify
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Web server
# Description: Web server
### END INIT INFO
#
# Source function library.
# Path to the siteguardlite package.
prefix=/opt/jp-secure/siteguardlite
if [ -r /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
fi
. $prefix/setup.config
web_bin=""
web_server=""
RETVAL=0
cd $prefix
start_stop() {
mode="shutdown"
mode_msg="Stopping"
no_error=$2
not_running=0
if [ $1 = "start" ]; then
mode="startup"
mode_msg="Starting"
fi
if [ $SERVER = "APACHE" ]; then
web_bin=$APACHEBIN
web_server="apache"
else
web_bin=$NGINXBIN
web_server="nginx"
fi
echo -n "$mode_msg : "
service_name=$SERVER_SERVICE
if [ -n "$service_name" ]; then
if systemctl is-active $service_name >/dev/null 2>&1; then
if [ $mode = "startup" ]; then
echo -n "Already running."
RETVAL=1
fi
else
if [ $mode = "shutdown" ]; then
if [ $no_error -eq 0 ]; then
echo -n "Not running."
RETVAL=1
else
not_running=1
fi
fi
fi
if [ $RETVAL = 0 ]; then
if [ $mode = "startup" ]; then
if ! systemctl start $service_name >/dev/null 2>&1; then
RETVAL=1
fi
elif [ $not_running -eq 0 ]; then
if ! systemctl stop $service_name >/dev/null 2>&1; then
RETVAL=1
fi
fi
fi
else
if pidof $web_bin >/dev/null 2>&1; then
if [ $mode = "startup" ]; then
echo -n "Already running."
RETVAL=1
fi
else
if [ $mode = "shutdown" ]; then
if [ $no_error -eq 0 ]; then
echo -n "Not running."
RETVAL=1
else
not_running=1
fi
fi
fi
if [ $RETVAL = 0 ]; then
if [ $mode = "startup" ]; then
if [ $SERVER = "APACHE" ]; then
if ! $APACHECTL start; then
RETVAL=1
fi
else
if ! $NGINXBIN; then
RETVAL=1
fi
fi
elif [ $not_running -eq 0 ]; then
if [ $SERVER = "APACHE" ]; then
if ! $APACHECTL stop; then
RETVAL=1
fi
else
if ! $NGINXBIN -s stop; then
RETVAL=1
fi
fi
fi
fi
fi
if [ $RETVAL = 0 ]; then
if type success >/dev/null 2>&1 ; then
success "$web_server $mode"
else
echo -n " [ OK ]"
fi
else
if type failure >/dev/null 2>&1 ; then
failure "$web_server $mode"
else
echo -n " [ FAILED ]"
fi
fi
echo
return $RETVAL
}
start() {
start_stop "start" 0
}
stop() {
start_stop "stop" 0
}
no_error_stop() {
start_stop "stop" 1
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
no-error-stop)
no_error_stop
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
exit $RETVAL