Script Development - Recovery from Missing Files
Introduction
In order to provide more flexibility, most major functions were separated into individual scripts. These scripts were invoked by upper-level scripts when necessary. In this case, managing the dependencies of scripts manually could be chaos, and the script needs to be able to get its dependencies automatically.
This section includes three parts: the idea, web server, and security.
The Idea
Each script should have a list of dependency files. At the beginning of execution, the script should check for the existence of its dependencies. If any of then is missing, it should be acquired from a remote source. The best common-used remote source is a web server.
Web Server
Since scripts are static resources, nginx is the best out-of-box choice. It is not necessary to set up a dedicated web server, and I decided to take advantage of the existing web servers.
Security
The content of scripts may contain sensitive information.
First, the URL of the resource was intentionally set to be complicated. This could somehow prevent unauthorized access.
For those scripts containing SSH/FTP/Database credentials and service ports, the content was omitted from the script hosting on the remote server. This could minimize the information leaked in case of unauthorized access.
Navigate through the Script Development Section
- Prev
- Design Principle
- Major Scripts
- Recovery from Missing Files
- Human Interaction Improvement and Auxiliary Scripts
- Next