Okay, this one is a little specific, but I recently had this issue and I wanted to share it because knowing this would have saved me one scripting language and a lot of time. I have previously implemented this in PowerShell, but it can easily be done in BaSH as well. The premise was to… Continue reading Wait for host in BaSH
Category: Bash
Get latest version from GitHub API
I am writing automated updaters for certain applications but I don’t want the update to be executed every day. Instead it should only run in case a new version is available. One key component to achieve this is to find out what the latest version is. If a software distributor is using GitHub and if… Continue reading Get latest version from GitHub API
Escaping in shells
First things first: A string with spaces is enclosed in either single quotes ‘ or double quotes “. The difference you ask? Single quotes are treated “as is”: No variable replacement, no parsing, just a string. If you want to embed a variable value, you have to concatenate the string. Period. Double quotes allow dynamic… Continue reading Escaping in shells
Zabbix agent deployment and configuration
Installation and configuration of the Zabbix agent, the counterpart of the Zabbix server, that collects and sends data to the server to be shown, is quite easy and can be done with a simple bash script. Now let’s imagine you have 1000 hosts and would have to do that on each and every one of… Continue reading Zabbix agent deployment and configuration
Parse JSON output from an API with Python
As great as PowerShell is with JSON objects you can’t always use it because it is not available on each and every machine with Linux out there. And I don’t know a way of parsing JSON code with plain bash properly. Fortunately a lot of servers come with “python” installed and it can be used… Continue reading Parse JSON output from an API with Python
Change date modified of files and delete files other than n days
I am working on a backup script on Linux and for that I need test data: Files that are modified on certain dates and that I can scan for. Of course I could create a file every day for the next month, but that would take a little too long. I found out, that one… Continue reading Change date modified of files and delete files other than n days