dygapp преди 4 години
родител
ревизия
5945742bcd
променени са 2 файла, в които са добавени 26 реда и са изтрити 26 реда
  1. 4 4
      app/controller/log.js
  2. 22 22
      config/shells.js

+ 4 - 4
app/controller/log.js

@@ -10,8 +10,8 @@ class LogController extends Controller {
       const type = ctx.request.query.type;
       let res;
       if (type === 'ssl') res = await this.service.shell.shell(`tail -n 100 ${filePath.ssllog}`);
-      if (type === 'sec') res = await this.service.shell.shell(`tail -n 100 ${filePath.swanlog}`);
-      if (type === 'systemct') res = await this.service.shell.shell(`tail -n 100 ${filePath.systemlog}`);
+      if (type === 'ipsec') res = await this.service.shell.shell(`tail -n 100 ${filePath.swanlog}`);
+      if (type === 'system') res = await this.service.shell.shell(`tail -n 100 ${filePath.systemlog}`);
       if (res.errcode === 0) {
         ctx.body = { errcode: 0, errmsg: '', data: res.data };
       } else {
@@ -28,8 +28,8 @@ class LogController extends Controller {
       const type = this.ctx.request.query.type;
       let res;
       if (type === 'ssl') res = await this.secservice.fileshandler.download({ filePath: filePath.ssllog });
-      if (type === 'sec') res = await this.secservice.fileshandler.download({ filePath: filePath.ssllog });
-      if (type === 'systemct') res = await this.secservice.fileshandler.download({ filePath: filePath.ssllog });
+      if (type === 'ipsec') res = await this.secservice.fileshandler.download({ filePath: filePath.ssllog });
+      if (type === 'system') res = await this.secservice.fileshandler.download({ filePath: filePath.ssllog });
       if (res) {
         this.ctx.body = res;
       } else {

+ 22 - 22
config/shells.js

@@ -2,52 +2,52 @@
 
 module.exports = {
   // strongswan相关命令
-  swIsEnabled: 'system is-enabled strongswan-swanctl',
+  swIsEnabled: 'systemctl is-enabled strongswan-swanctl',
   // 查看strongswan服务是否开机自启动
-  swEnable: 'system enable strongswan-swanctl',
+  swEnable: 'systemctl enable strongswan-swanctl',
   // 开启strongswan服务的自启动
-  swDisable: 'system disable strongswan-swanctl',
+  swDisable: 'systemctl disable strongswan-swanctl',
   // 关闭strongswan服务的自启动
-  swStatus: 'system status strongswan-swanctl',
+  swStatus: 'systemctl status strongswan-swanctl',
   // 查看strongswan服务是否正在运行
-  swStart: 'system start strongswan-swanctl',
+  swStart: 'systemctl start strongswan-swanctl',
   // 启动strongswan服务
-  swRestart: 'system restart strongswan-swanctl',
+  swRestart: 'systemctl restart strongswan-swanctl',
   // 重启strongswan服务
-  swStop: 'system stop strongswan-swanctl',
+  swStop: 'systemctl stop strongswan-swanctl',
   // 停止strongswan服务
-  swReload: 'system reload strongswan-swanctl',
+  swReload: 'systemctl reload strongswan-swanctl',
 
   // openvpn相关命令
-  opIsEnabled: 'system is-enabled openvpn',
+  opIsEnabled: 'systemctl is-enabled openvpn',
   // 查看Openvpn是否开机自启动
-  opEnable: 'system enable openvpn',
+  opEnable: 'systemctl enable openvpn',
   // 打开Openvpn服务的自启动
-  opDisable: 'system disable openvpn',
+  opDisable: 'systemctl disable openvpn',
   // 关闭Openvpn服务的自启动
-  opStatus: 'system status openvpn',
+  opStatus: 'systemctl status openvpn',
   // 查看Openvpn服务是否正在运行
-  opStart: 'system start openvpn',
+  opStart: 'systemctl start openvpn',
   // 启动Openvpn服务
-  opRestart: 'system restart openvpn',
+  opRestart: 'systemctl restart openvpn',
   // 重启Openvpn服务
-  opStop: 'system stop openvpn',
+  opStop: 'systemctl stop openvpn',
   // 停止Openvpn服务
 
   //  dhcp相关命令
-  dhcpIsEnabled: 'system is-enabled isc-dhcp-server',
+  dhcpIsEnabled: 'systemctl is-enabled isc-dhcp-server',
   // 查看dhcp是否开机自启动
-  dhcpEnable: 'system enable isc-dhcp-server',
+  dhcpEnable: 'systemctl enable isc-dhcp-server',
   // 打开dhcp服务的自启动
-  dhcpDisable: 'system disable isc-dhcp-server',
+  dhcpDisable: 'systemctl disable isc-dhcp-server',
   // 关闭dhcp服务的自启动
-  dhcpStatus: 'system status isc-dhcp-server',
+  dhcpStatus: 'systemctl status isc-dhcp-server',
   // 查看dhcp服务是否正在运行
-  dhcpStart: 'system start isc-dhcp-server',
+  dhcpStart: 'systemctl start isc-dhcp-server',
   // 启动dhcp服务
-  dhcpRestart: 'system restart isc-dhcp-server',
+  dhcpRestart: 'systemctl restart isc-dhcp-server',
   // 重启dhcp服务
-  dhcpStop: 'system stop isc-dhcp-server',
+  dhcpStop: 'systemctl stop isc-dhcp-server',
   // 停止dhcp服务
 
   // 网络配置相关命令