Search

CN-121996260-A - Shell-based method and system for realizing software automation task

CN121996260ACN 121996260 ACN121996260 ACN 121996260ACN-121996260-A

Abstract

The embodiment of the invention discloses a method and a system for realizing software automation tasks based on shell, wherein the method comprises the steps of determining the automation tasks, wherein the automation tasks comprise at least one of automatic installation of software, automatic upgrading of the software and automatic unloading of the software, writing shell scripts according to the automation tasks, wherein the shell scripts comprise at least one of shell installation scripts, shell starting scripts, shell upgrading scripts and shell unloading scripts, completing the automation tasks by executing the shell scripts, verifying the completion results of the automation tasks to obtain verification results, and optimizing and improving the shell scripts according to the verification results. The method realizes automatic installation, upgrading and unloading of one command of the software, and meets the requirements of rapid deployment and installation in local area networks and multiple network points.

Inventors

  • XU SU
  • DONG ZHIFENG

Assignees

  • 深圳市海洋王照明工程有限公司
  • 海洋王照明科技股份有限公司
  • 海洋王(东莞)照明科技有限公司
  • 深圳市海洋王电网照明技术有限公司
  • 深圳市海洋王铁路照明技术有限公司
  • 深圳市海洋王石油照明技术有限公司
  • 深圳市海洋王绿色照明技术有限公司
  • 深圳市海洋王公消照明技术有限公司
  • 深圳市海洋王冶金照明技术有限公司
  • 深圳市海洋王石化照明技术有限公司
  • 深圳市海洋王船舶场馆照明技术有限公司
  • 深圳市海洋王技术有限公司

Dates

Publication Date
20260508
Application Date
20241104

Claims (10)

  1. 1. A method for implementing software automation tasks based on shell, the method comprising: Determining an automation task, wherein the automation task comprises at least one of automatic installation of software, automatic upgrading of the software and automatic unloading of the software; Writing a shell script according to the automation task, wherein the shell script comprises at least one of a shell installation script, a shell starting script, a shell upgrading script and a shell unloading script; Completing the automation task by executing the shell script; verifying the completion result of the automatic task to obtain a verification result; and optimizing and improving the shell script according to the verification result.
  2. 2. The method for implementing a software automation task based on a shell according to claim 1, wherein when the automation task is an automated installation of software, the method for implementing the automation task by executing the shell script specifically includes: the shell script is started, wherein the shell script is automatically started after the server is started; Acquiring service information recorded in the shell script; judging whether the service information exists in the server or not; if the service information exists in the server, completing automatic starting of the software by executing a shell starting script; and if the service information does not exist in the server, completing automatic installation and starting of the software by executing the shell installation script and the shell starting script.
  3. 3. The method for implementing software automation tasks based on shell according to claim 2, wherein the implementing the software automation installation and startup by executing shell installation script and shell startup script specifically comprises: Executing shell installation scripts; Acquiring installation package information corresponding to software in a server through shell commands; Processing the installation package information into a service package; constructing service information of the software by utilizing the service package; executing shell startup script; and starting software according to the reserved information of the shell starting script.
  4. 4. The method for implementing software automation tasks based on shell according to claim 2, wherein the implementing the shell startup script to complete the software automation startup specifically comprises: the staff selects and double-clicks the starting file; Sequentially executing shell commands in the file; the service in the file determines a starting mode through deployment software contained in a software package, wherein the starting mode comprises one of a native service starting mode and other starting modes.
  5. 5. The method for implementing a software automation task based on a shell according to claim 1, wherein when the automation task is an automation upgrade of software, the method for implementing the automation task by executing the shell script specifically includes: Executing a shell upgrading script; Acquiring service information of software to be upgraded in a server; Stopping the service of the software to be upgraded according to the service information of the software to be upgraded; Replacing the software package of the software to be upgraded with an upgraded software package; and completing the automatic upgrading of the software to be upgraded by executing the shell installation script.
  6. 6. The method for implementing a software automation task based on a shell according to claim 1, wherein when the automation task is an automatic uninstallation of software, the method for implementing the automation task by executing the shell script specifically includes: executing shell uninstalling script; acquiring service information of software to be uninstalled in a server; and stopping the service of the software to be uninstalled according to the service information of the software to be uninstalled.
  7. 7. The method for implementing software automation tasks based on shell according to claim 1, wherein the verifying the completion result of the automation tasks to obtain a verification result specifically comprises: when the automatic task is automatic installation of the software, checking whether the software is successfully installed and operated; When the automatic task is automatic upgrading of the software, checking whether the software is successfully upgraded and operated; and when the automatic task is automatic unloading of the software, checking whether the software is successfully unloaded.
  8. 8. A system for implementing software automation tasks based on shell, the system comprising: The system comprises a task determining module, a task processing module and a task processing module, wherein the task determining module is used for determining an automatic task, and the automatic task comprises at least one of automatic installation of software, automatic upgrading of the software and automatic unloading of the software; The shell script comprises at least one of a shell installation script, a shell starting script, a shell upgrading script and a shell unloading script; The task completion module is used for completing the automatic task by executing the shell script; The verification result acquisition module is used for verifying the completion result of the automatic task to obtain a verification result; And the optimizing module is used for optimizing and improving the shell script according to the verification result.
  9. 9. The system for implementing software automation tasks based on shell according to claim 8, wherein when the automation tasks are automatic installation of software, the task completion module is specifically configured to: the shell script is started, wherein the shell script is automatically started after the server is started; Acquiring service information recorded in the shell script; judging whether the service information exists in the server or not; if the service information exists in the server, completing automatic starting of the software by executing a shell starting script; and if the service information does not exist in the server, completing automatic installation and starting of the software by executing the shell installation script and the shell starting script.
  10. 10. The system for implementing software automation tasks based on shell according to claim 8, wherein when the automation tasks are automatic upgrades of software, the task completion module is specifically configured to: Executing a shell upgrading script; Acquiring service information of software to be upgraded in a server; Stopping the service of the software to be upgraded according to the service information of the software to be upgraded; Replacing the software package of the software to be upgraded with an upgraded software package; and completing the automatic upgrading of the software to be upgraded by executing the shell installation script.

Description

Shell-based method and system for realizing software automation task Technical Field The invention relates to the technical field of software systems of the Internet, in particular to a method and a system for realizing software automation tasks based on shell. Background In recent years, with the rapid development of information technology, functions of various system platforms are more and more perfected, and meanwhile, a traditional installation mode is more and more complicated. In the prior art, the installation, upgrading and uninstallation of the system need more or less professional knowledge of the related Internet, and especially when people who are in local area network and cannot remotely perform control are required to perform the operation of installing, upgrading and uninstalling the software without the related professional knowledge, the operation is extremely difficult and complicated. Therefore, there is a need for a method to improve the ease of software installation, upgrade, and uninstallation. Disclosure of Invention Based on this, it is necessary to provide a method and a system for implementing software automation tasks based on shell aiming at the above problems. First aspect A method for implementing software automation tasks based on shell, the method comprising: Determining an automation task, wherein the automation task comprises at least one of automatic installation of software, automatic upgrading of the software and automatic unloading of the software; Writing a shell script according to the automation task, wherein the shell script comprises at least one of a shell installation script, a shell starting script, a shell upgrading script and a shell unloading script; Completing the automation task by executing the shell script; verifying the completion result of the automatic task to obtain a verification result; and optimizing and improving the shell script according to the verification result. Preferably, when the automation task is automatic installation of software, the completing the automation task by executing the shell script specifically includes: the shell script is started, wherein the shell script is automatically started after the server is started; Acquiring service information recorded in the shell script; judging whether the service information exists in the server or not; if the service information exists in the server, completing automatic starting of the software by executing a shell starting script; and if the service information does not exist in the server, completing automatic installation and starting of the software by executing the shell installation script and the shell starting script. Preferably, the automatic installation and starting of the software is completed by executing a shell installation script and a shell starting script, which specifically includes: Executing shell installation scripts; Acquiring installation package information corresponding to software in a server through shell commands; Processing the installation package information into a service package; constructing service information of the software by utilizing the service package; executing shell startup script; and starting software according to the reserved information of the shell starting script. Preferably, the automatic starting of the software is completed by executing the shell starting script, which specifically includes: the staff selects and double-clicks the starting file; Sequentially executing shell commands in the file; the service in the file determines a starting mode through deployment software contained in a software package, wherein the starting mode comprises one of a native service starting mode and other starting modes. Preferably, when the automation task is an automation upgrade of software, the completing the automation task by executing the shell script specifically includes: Executing a shell upgrading script; Acquiring service information of software to be upgraded in a server; Stopping the service of the software to be upgraded according to the service information of the software to be upgraded; Replacing the software package of the software to be upgraded with an upgraded software package; and completing the automatic upgrading of the software to be upgraded by executing the shell installation script. Preferably, when the automation task is the automatic uninstallation of the software, the completing the automation task by executing the shell script specifically includes: executing shell uninstalling script; acquiring service information of software to be uninstalled in a server; and stopping the service of the software to be uninstalled according to the service information of the software to be uninstalled. Preferably, the verifying the completion result of the automation task to obtain a verification result specifically includes: when the automatic task is automatic installation of the software, checking whether the software is successfully i