FILE="linux1.txt"
HOST=`hostname -s`.skills.lan
IP=`ip addr | grep 'inet 10.4.' | awk '{print $2}' | awk -F/ '{print $1}'`
echo -e "\n! hostname and ip" > $FILE
hostname >> $FILE
i=`nmcli con show | awk 'NR==2{print $1}'`
nmcli c show $i | egrep "ipv4.method|ipv4.address|ipv4.dns:" >> $FILE
echo -e "\n! install" >> $FILE
dnf list --installed bind chrony httpd mod_ssl ansible-core | awk 'NR>1 {print $1}' | awk -F. '{print $1}' >> $FILE
echo -e "\n! chrony" >> $FILE
ping -c 5 linux2.skills.lan > /dev/null 2>&1
chronyc clients | grep skills | awk '{print $1}' | sort >> $FILE
echo -e "\n! ssh" >> $FILE
for i in {1..9}; do ssh linux$i.skills.lan hostname -s; done >> $FILE
echo -e "\n! DNS" >> $FILE
file /var/named/named.{skills,10} >> $FILE
echo -e "\n! skills.lan" >> $FILE
named-checkzone -f text skills.lan /var/named/named.skills | awk 'NR>1' >> $FILE
echo -e "\n! 220.4.10" >> $FILE
named-checkzone -f text 220.4.10.in-addr.arpa /var/named/named.10 | awk 'NR>1' >> $FILE
echo -e "\n! A PTR" >> $FILE
host -l skills.lan | sort >> $FILE
host -l -t MX skills.lan >> $FILE
host -l 220.4.10.in-addr.arpa | sort | grep "skills.lan" >> $FILE
echo -e "\n! ansible" >> $FILE
ansible all -m ping | grep "SUCCESS" | wc -l >> $FILE
echo -e "\n! CA" >> $FILE
echo -e "\n! cacert.pem" >> $FILE
openssl x509 -in /etc/pki/CA/cacert.pem -noout -subject -issuer >> $FILE
openssl x509 -in /etc/pki/CA/cacert.pem -noout -enddate | awk '{print $4}' >> $FILE
echo -e "\n! skills.crt" >> $FILE
openssl x509 -in /etc/pki/tls/skills.crt -noout -subject -issuer -ext subjectAltName >> $FILE
openssl x509 -in /etc/pki/tls/skills.crt -noout -enddate | awk '{print $4}' >> $FILE
echo -e "\n! apache2" >> $FILE
file /etc/pki/tls/{apache,skills}.* >> $FILE
echo -e "\n! https://$IP/" >> $FILE
curl -s --cert /etc/pki/tls/skills.crt --key /etc/pki/tls/skills.key https://$IP/ -k >> $FILE
echo -e "\n! https://$HOST/" >> $FILE
curl -s --cert /etc/pki/tls/skills.crt --key /etc/pki/tls/skills.key https://$HOST/ >> $FILE
echo -e "\n! https://skills.lan crt" >> $FILE
curl -s --cert /etc/pki/tls/skills.crt --key /etc/pki/tls/skills.key https://skills.lan/ >> $FILE
echo -e "\n! https://web.skills.lan" >> $FILE
curl -s --cert /etc/pki/tls/skills.crt --key /etc/pki/tls/skills.key https://web.skills.lan/ >> $FILE
echo -e "\n! https://www.skills.lan crt" >> $FILE
curl -s --cert /etc/pki/tls/skills.crt --key /etc/pki/tls/skills.key https://www.skills.lan/ >> $FILE
echo -e "\n! https://www.skills.lan pem" >> $FILE
curl -s --cert /etc/pki/tls/skills.pem https://www.skills.lan/ >> $FILE
echo -e "\n! https://www.skills.lan apache" >> $FILE
curl -s --cert /etc/pki/tls/apache.crt --key /etc/pki/tls/apache.key https://www.skills.lan/ >> $FILE
echo -e "\n! systemctl is-enabled" >> $FILE
systemctl list-unit-files | grep -E "firewalld.service|^named.service|chronyd.service|httpd.service" | awk '{print $1,$2}' >> $FILE
- 1
- 2
前往页