Skip to content

Instantly share code, notes, and snippets.

@usiusi360
Last active May 22, 2018 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usiusi360/000074b4e117cf196fd3806537089534 to your computer and use it in GitHub Desktop.
Save usiusi360/000074b4e117cf196fd3806537089534 to your computer and use it in GitHub Desktop.
#!/bin/bash
while read line
do
SERVERNAME=`echo "$line" | cut -f1`
FAMILY=`echo "$line" | cut -f2`
RELEASE=`echo "$line" | cut -f3`
IPADDRS=`echo "$line" | cut -f4`
sed -i -e s/\"Family\":\"pseudo\"/\"Family\":\"${FAMILY}\"/g \
-e s/\"Release\":\"\"/\"Release\":\"${RELEASE}\"/g \
-e s/\"IPv4Addrs\":null/\"IPv4Addrs\":\"${IPADDRS}\"/g \
results/current/${SERVERNAME}.json
done < hostlist.tsv
@usiusi360
Copy link
Author

usiusi360 commented May 22, 2018

hostlist.tsvの中身

[root@localhost vuls]# cat hostlist.tsv 
192-168-0-1     centos  7.4     192.168.0.1
192-168-0-2     redhat  7.4     192.168.0.2
192-168-0-3     debian  9.4     192.168.0.3
192-168-0-4     ubuntu  18.04   192.168.0.4

@usiusi360
Copy link
Author

usiusi360 commented May 22, 2018

実行順

① vuls scan
② change_hostinfo.sh
③ vuls report -to-syslog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment