403Webshell
Server IP : 172.67.179.166  /  Your IP : 172.71.24.53
Web Server : nginx/1.20.2
System : Linux 172-104-110-161.ip.linodeusercontent.com 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64
User : www ( 1000)
PHP Version : 8.1.9
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /etc/rc2.d/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /etc/rc2.d/S55bt_syssafe
#!/bin/bash
# chkconfig: 2345 55 25
# description: bt.cn Syssafe

### BEGIN INIT INFO
# Provides:          bt_syssafe
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts bt_syssafe
# Description:       starts the bt_syssafe
### END INIT INFO

panel_path=/www/server/panel/plugin/syssafe
python_bin='python'
if [ -f /www/server/panel/pyenv/bin/python ];then
    python_bin='/www/server/panel/pyenv/bin/python'
fi
cd $panel_path
panel_start()
{
        isStart=$(ps aux |grep -E "(bt_syssafe|syssafe_main)"|grep -v grep|grep -v "/etc/init.d/bt_syssafe"|awk '{print $2}'|xargs)
        if [ "$isStart" == '' ];then
                echo -e "Starting Bt-Syssafe service... \c"
                nohup $python_bin $panel_path/bt_syssafe &> $panel_path/service.log &
                sleep 0.5
                isStart=$(ps aux |grep -E "(bt_syssafe|syssafe_main)"|grep -v grep|grep -v "/etc/init.d/bt_syssafe"|awk '{print $2}'|xargs)
                if [ "$isStart" == '' ];then
                        echo -e "\033[31mfailed\033[0m"
                        echo '------------------------------------------------------'
                        cat $panel_path/service.log
                        echo '------------------------------------------------------'
                        echo -e "\033[31mError: Bt-Syssafe service startup failed.\033[0m"
                        return;
                fi
                echo -e "\033[32mdone\033[0m"
        else
                echo "Starting  Bt-Syssafe service (pid $isStart) already running"
        fi
}

panel_stop()
{
	echo -e "Stopping Bt-Syssafe service... \c";
        pids=$(ps aux |grep -E "(bt_syssafe|syssafe_main)"|grep -v grep|grep -v "/etc/init.d/bt_syssafe"|awk '{print $2}'|xargs)
        arr=($pids)

        for p in ${arr[@]}
        do
                kill -9 $p
        done
        $python_bin $panel_path/stop.py
        echo -e "\033[32mdone\033[0m"
}

panel_status()
{
        isStart=$(ps aux |grep -E "(bt_syssafe|syssafe_main)"|grep -v grep|grep -v "/etc/init.d/bt_syssafe"|awk '{print $2}'|xargs)
        if [ "$isStart" != '' ];then
                echo -e "\033[32mBt-Syssafe service (pid $isStart) already running\033[0m"
        else
                echo -e "\033[31mBt-Syssafe service not running\033[0m"
        fi
}

case "$1" in
        'start')
                panel_start
                ;;
        'stop')
                panel_stop
                ;;
        'restart')
                panel_stop
                sleep 0.2
                panel_start
                ;;
        'reload')
                panel_stop
                sleep 0.2
                panel_start
                ;;
        'status')
                panel_status
                ;;
        *)
                echo "Usage: /etc/init.d/bt_syssafe {start|stop|restart|reload}"
        ;;
esac

Youez - 2016 - github.com/yon3zu
LinuXploit