#!/usr/bin/env bash function cecho { while [ "$1" ]; do case "$1" in -normal) color="\033[00m" ;; -black) color="\033[30;01m" ;; -red) color="\033[31;01m" ;; -green) color="\033[32;01m" ;; -yellow) color="\033[33;01m" ;; -blue) color="\033[34;01m" ;; -magenta) color="\033[35;01m" ;; -cyan) color="\033[36;01m" ;; -white) color="\033[37;01m" ;; -n) one_line=1; shift ; continue ;; *) echo -n "$1"; shift ; continue ;; esac shift echo -en "$color" echo -en "$1" echo -en "\033[00m" shift done if [ ! $one_line ]; then echo fi } servers=( #art-decor.agence-esante.lu #art-decor.ihe-europe.net #data.ihe-europe.net #gazelle.agence-esante.lu #gazelle.ehealth.brussels #gazellecontent.sequoiaproject.org #inter-amc.kereval:q.com #nagios.ihe-europe.net #order-manager.ihe-europe.net #ovh1.ihe-europe.net #ovh2.ihe-europe.net #ovh3.ihe-europe.net #ovh4.ihe-europe.net #portal.ihe-europe.net #testing.consorzioarsenal.it #testivalidointipalvelu.kanta.fi #validointipalvelu.kanta.fi gazelle.ehdsi.ihe-europe.net ) for i in "${servers[@]}" do cecho -blue "=======================================" cecho -blue "working on $i" cecho -blue "=======================================" ssh gazelle@$i 'echo "* *"`date +'%y%m%d'` "eric poiseau* : checked that apache2 server signature is turned off" >>/home/gazelle/info.md' ssh gazelle@$i "sudo sed -i 's/serversignature on/serversignature off/g' /etc/apache2/conf-available/security.conf" ssh gazelle@$i "sudo apache2ctl restart" ssh gazelle@$i "sudo /sbin/iptables -i input 1 -p icmp --icmp-type timestamp-reply -j drop" ssh gazelle@$i "sudo /sbin/iptables -i input 1 -p icmp --icmp-type timestamp-request -j drop" ssh gazelle@$i 'echo "* *"`date +'%y%m%d'` "eric poiseau* : checked that ipv4 tcp timestamps are turned off" >>/home/gazelle/info.md' ssh gazelle@$i "sudo sed -i 's/net.ipv4.tcp_timestamps=1/net.ipv4.tcp_timestamps=0/g' /etc/sysctl.conf" done