aaden-cli 1.2.24 → 1.2.26

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.
@@ -10,7 +10,7 @@ echo "0 */12 * * * wget -O /dev/null http://localhost/PHP/CloudStuff/ReportAllTe
10
10
  echo "* * * * * wget -O /dev/null http://localhost/PHP/CloudStuff/FetchOrdersForAllTerminal.php" >>conf
11
11
  echo "* * * * * wget -O /dev/null http://localhost/PHP/AccessLog.php?op=reportStatus" >>conf
12
12
  echo "* * * * * /var/www/html/crontab.sh > /dev/null" >>conf
13
- echo "59 4 1 * * wget -O /dev/null http://localhost/PHP/Datev.php?op=autoSendDatevCsv > /dev/null" >>conf
13
+ echo "0 * * * * wget -O /dev/null http://localhost/PHP/Datev.php?op=autoSendDatevCsv > /dev/null" >>conf
14
14
  echo "* * * * * curl --location --request GET 'http://localhost/PHP/BackendData.php?op=autoSend3In1'" >>conf
15
15
  echo "* * * * * curl --location --request GET 'http://localhost/PHP/BackendData.php?op=autoSendMonthSummary'" >>conf
16
16
  sudo crontab -u aaden -r
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+
3
+ ServiceFileName=/etc/systemd/system/aaden-gdpdu.service
4
+
5
+ sudo touch $ServiceFileName
6
+ sudo chmod 777 $ServiceFileName
7
+ echo -e "
8
+ [Unit]
9
+ Description=Gdpdu Service For Aaden
10
+
11
+ [Service]
12
+ Type=simple
13
+ Restart=always
14
+ RestartSec=1
15
+ User=root
16
+ ExecStart=/usr/bin/php /var/www/html/PHP/autoWriteGdpdu.php
17
+
18
+ [Install]
19
+ WantedBy=multi-user.target
20
+ " > $ServiceFileName
21
+
22
+ sudo systemctl start aaden-gdpdu.service
23
+ sudo systemctl enable aaden-gdpdu.service
24
+ echo 'gdpdu auto write start'
25
+ sudo service aaden-gdpdu start
package/dist/index.js CHANGED
@@ -58161,7 +58161,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.19.2","description":"P
58161
58161
  /***/ ((module) => {
58162
58162
 
58163
58163
  "use strict";
58164
- module.exports = {"i8":"1.2.23"};
58164
+ module.exports = {"i8":"1.2.25"};
58165
58165
 
58166
58166
  /***/ }),
58167
58167
 
@@ -58450,6 +58450,15 @@ program.command('enable-resource-track').action(enableResourceTrack)
58450
58450
  program.command('start-resource-track').action(startResourceTrack)
58451
58451
  program.command('auto-send-mail').action(editIni)
58452
58452
  program.command('auto-send-summary').action(autoSendSummaryLastMonth)
58453
+ program.command('set-do-not-send-zbon-when-print-true').
58454
+ action(editConfigIni(setConfig('Email', 'DoNotSendZbonWhenPrint', true)))
58455
+ program.command('set-do-not-send-zbon-when-print-false').
58456
+ action(editConfigIni(setConfig('Email', 'DoNotSendZbonWhenPrint', false)))
58457
+ program.command('set-auto-send-3in1-today-true').
58458
+ action(editConfigIni(setConfig('Email', 'AutoSend3in1Today', true)))
58459
+ program.command('set-auto-send-3in1-today-false').
58460
+ action(editConfigIni(setConfig('Email', 'AutoSend3in1Today', false)))
58461
+ program.command('auto-write-gdpdu').action(autoWriteGdpdu)
58453
58462
 
58454
58463
  if (program.debug) {
58455
58464
  debugInfo()
@@ -59073,18 +59082,13 @@ function editIni () {
59073
59082
  cli.executeInShell([
59074
59083
  'sudo chmod 777 /var/www/html/Resource/config/config.ini',
59075
59084
  'aaden-cli fix-cronjob',
59076
- ],program.debug)
59077
- const ini = __nccwpck_require__(80045)
59078
- const filePath = '/var/www/html/Resource/config/config.ini'
59079
- const info = ini.parse(fs.readFileSync(filePath, 'utf-8'))
59080
- console.log(info)
59081
- if(!info.Email) {
59082
- info.Email = {}
59083
- }
59084
- info.Email.AutoSend3in1LastMonth = true
59085
-
59086
- fs.writeFileSync(filePath, ini.stringify(info))
59085
+ ], program.debug)
59087
59086
 
59087
+ editConfigIni(composeMany([
59088
+ setConfig('Email', 'AutoSend3in1LastMonth', true),
59089
+ setConfig('Email', 'DoNotSendZbonWhenPrint', true),
59090
+ setConfig('Email', 'AutoSend3in1Today', false),
59091
+ ]))()
59088
59092
  }
59089
59093
 
59090
59094
  function autoSendSummaryLastMonth () {
@@ -59092,17 +59096,32 @@ function autoSendSummaryLastMonth () {
59092
59096
  'sudo chmod 777 /var/www/html/Resource/config/config.ini',
59093
59097
  'aaden-cli fix-cronjob',
59094
59098
  ], program.debug)
59095
- const ini = __nccwpck_require__(80045)
59096
- const filePath = '/var/www/html/Resource/config/config.ini'
59097
- const info = ini.parse(fs.readFileSync(filePath, 'utf-8'))
59098
- console.log(info)
59099
- if (!info.Email) {
59100
- info.Email = {}
59099
+
59100
+ editConfigIni(setConfig('Email', 'AutoSendSummaryLastMonth', true))()
59101
+ }
59102
+
59103
+ function editConfigIni (f) {
59104
+ return () => {
59105
+ const ini = __nccwpck_require__(80045)
59106
+ const filePath = '/var/www/html/Resource/config/config.ini'
59107
+ const info = ini.parse(fs.readFileSync(filePath, 'utf-8'))
59108
+ f(info)
59109
+ fs.writeFileSync(filePath, ini.stringify(info))
59101
59110
  }
59102
- info.Email.AutoSendSummaryLastMonth = true
59111
+ }
59103
59112
 
59104
- fs.writeFileSync(filePath, ini.stringify(info))
59113
+ function setConfig (section, key, value) {
59114
+ return file => {
59115
+ if (!file[section]) {
59116
+ file[section] = {}
59117
+ }
59118
+ file[section][key] = value
59119
+ return file
59120
+ }
59121
+ }
59105
59122
 
59123
+ function composeMany (fs) {
59124
+ return fs.reduce((f, g) => x => g(f(x)), x => x)
59106
59125
  }
59107
59126
 
59108
59127
  function getPrivilegeCMD (path, pri = '+x', relativePath = true) {
@@ -59114,6 +59133,11 @@ function getPrivilegeCMD (path, pri = '+x', relativePath = true) {
59114
59133
  return command
59115
59134
  }
59116
59135
 
59136
+ function autoWriteGdpdu () {
59137
+ const files = ['AadenDeploy/Utils/writeGdpduService.sh']
59138
+ runMultiple(files)
59139
+ }
59140
+
59117
59141
  })();
59118
59142
 
59119
59143
  module.exports = __webpack_exports__;
package/index.js CHANGED
@@ -69,6 +69,15 @@ program.command('enable-resource-track').action(enableResourceTrack)
69
69
  program.command('start-resource-track').action(startResourceTrack)
70
70
  program.command('auto-send-mail').action(editIni)
71
71
  program.command('auto-send-summary').action(autoSendSummaryLastMonth)
72
+ program.command('set-do-not-send-zbon-when-print-true').
73
+ action(editConfigIni(setConfig('Email', 'DoNotSendZbonWhenPrint', true)))
74
+ program.command('set-do-not-send-zbon-when-print-false').
75
+ action(editConfigIni(setConfig('Email', 'DoNotSendZbonWhenPrint', false)))
76
+ program.command('set-auto-send-3in1-today-true').
77
+ action(editConfigIni(setConfig('Email', 'AutoSend3in1Today', true)))
78
+ program.command('set-auto-send-3in1-today-false').
79
+ action(editConfigIni(setConfig('Email', 'AutoSend3in1Today', false)))
80
+ program.command('auto-write-gdpdu').action(autoWriteGdpdu)
72
81
 
73
82
  if (program.debug) {
74
83
  debugInfo()
@@ -692,18 +701,13 @@ function editIni () {
692
701
  cli.executeInShell([
693
702
  'sudo chmod 777 /var/www/html/Resource/config/config.ini',
694
703
  'aaden-cli fix-cronjob',
695
- ],program.debug)
696
- const ini = require("ini")
697
- const filePath = '/var/www/html/Resource/config/config.ini'
698
- const info = ini.parse(fs.readFileSync(filePath, 'utf-8'))
699
- console.log(info)
700
- if(!info.Email) {
701
- info.Email = {}
702
- }
703
- info.Email.AutoSend3in1LastMonth = true
704
-
705
- fs.writeFileSync(filePath, ini.stringify(info))
704
+ ], program.debug)
706
705
 
706
+ editConfigIni(composeMany([
707
+ setConfig('Email', 'AutoSend3in1LastMonth', true),
708
+ setConfig('Email', 'DoNotSendZbonWhenPrint', true),
709
+ setConfig('Email', 'AutoSend3in1Today', false),
710
+ ]))()
707
711
  }
708
712
 
709
713
  function autoSendSummaryLastMonth () {
@@ -711,17 +715,32 @@ function autoSendSummaryLastMonth () {
711
715
  'sudo chmod 777 /var/www/html/Resource/config/config.ini',
712
716
  'aaden-cli fix-cronjob',
713
717
  ], program.debug)
714
- const ini = require("ini")
715
- const filePath = '/var/www/html/Resource/config/config.ini'
716
- const info = ini.parse(fs.readFileSync(filePath, 'utf-8'))
717
- console.log(info)
718
- if (!info.Email) {
719
- info.Email = {}
718
+
719
+ editConfigIni(setConfig('Email', 'AutoSendSummaryLastMonth', true))()
720
+ }
721
+
722
+ function editConfigIni (f) {
723
+ return () => {
724
+ const ini = require('ini')
725
+ const filePath = '/var/www/html/Resource/config/config.ini'
726
+ const info = ini.parse(fs.readFileSync(filePath, 'utf-8'))
727
+ f(info)
728
+ fs.writeFileSync(filePath, ini.stringify(info))
720
729
  }
721
- info.Email.AutoSendSummaryLastMonth = true
730
+ }
722
731
 
723
- fs.writeFileSync(filePath, ini.stringify(info))
732
+ function setConfig (section, key, value) {
733
+ return file => {
734
+ if (!file[section]) {
735
+ file[section] = {}
736
+ }
737
+ file[section][key] = value
738
+ return file
739
+ }
740
+ }
724
741
 
742
+ function composeMany (fs) {
743
+ return fs.reduce((f, g) => x => g(f(x)), x => x)
725
744
  }
726
745
 
727
746
  function getPrivilegeCMD (path, pri = '+x', relativePath = true) {
@@ -732,3 +751,8 @@ function getPrivilegeCMD (path, pri = '+x', relativePath = true) {
732
751
  command.push(`echo "Innerken322." | sudo -S chmod ${pri} ${path}`)
733
752
  return command
734
753
  }
754
+
755
+ function autoWriteGdpdu () {
756
+ const files = ['AadenDeploy/Utils/writeGdpduService.sh']
757
+ runMultiple(files)
758
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aaden-cli",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {