To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 644e1cd4 authored by Axel Beckert's avatar Axel Beckert

UI change: only check the hosts on the commandline if present

Add option -a to restore the old behaviour.
parent 25a7bcb4
......@@ -24,6 +24,8 @@ been modified (via `sha256sum`) and does not delete it at the end of
the check it in that case. Exits with exit-code ≠ 0 if anything is
found on one of the host.
### Commandline Options
Both commands understand the `-v` and `-d` commandline options:
* `-v` makes the output verbose: It adds a summary. (By default no
......@@ -33,13 +35,21 @@ Both commands understand the `-v` and `-d` commandline options:
which are commonly there on most Linux systems. They belong to the
fictional incident "DEBUG".
`ioc-remote-check.sh` also knows `-a`:
* `-a` (mnemonic: "all" or "add") causes both, the hosts on the
commandline and the hosts in the file `hosts` to be checked.
### Configuration of Hosts to Scan
`ioc-remote-check.sh` looks for a file named `hosts` in the current
directory. The file format is one host per line. Unix-style comments
(lines starting with `#`) are supported.
If any host is given to `ioc-remote-check.sh` on the commandline, it
checks only these. (This is a change from the initial release.)
Then it adds all hostnames given on the commandline.
If none is given or the option `-a` is given,`ioc-remote-check.sh`
looks for a file named `hosts` in the current directory. The file
format is one host per line. Unix-style comments (lines starting with
`#`) are supported and hence such lines are ignored. Blank lines are
ignored, too.
If neither a file exists nor hostnames are given on the
commandline. only `localhost` is checked.
......
#!/bin/sh
if [ -f hosts ]; then
hosts=$(egrep -v '^#' hosts);
fi
# Figuring out which hosts to scan
params=''
addhosts=0
for host in "$@"; do
if [ "$host" = '-v' -o "$host" = "-d" ]; then
params="$params $host"
elif [ "$host" = '-a' ]; then
addhosts=1
else
hosts="$hosts $host";
fi
done
if [ -f hosts -a '(' "$addhosts" = 1 -o -z "$hosts" ')' ]; then
hosts="$hosts $(egrep -v '^#' hosts)";
fi
if [ -z "$hosts" ]; then
hosts=localhost
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment