#!/usr/bin/env bash DESC="Test DHCP (serveur:bigboss et client:tiny)" HELP=" Bigboss et tiny doivent avoir été configurés par baseConfig. " SYSTEMS="bigboss tiny" run() { local localErrors=0 requireSshGuests $SYSTEMS tinyMAC=$(vdn-ssh root@tiny ifconfig eth1 | grep ether) tinyMAC=$(echo "$tinyMAC" | sed -re 's/^.*ether ([[:xdigit:]:]*).*$/\1/') vdnTest "DHCP configuré sur bigboss ?" "vdn-ssh root@bigboss \"grep -q '^[^#]*$tinyMAC' /etc/dhcp/dhcpd.conf\"" vdnTest "DHCP sur bigboss : actif ?" "vdn-ssh root@bigboss \"systemctl status isc-dhcp-server | grep -q 'Active: active'\"" echo vdnTest "FTP anonyme sur bigboss ?" "vdn-ssh root@tiny ' echo -e \'open bigboss\nuser anonymous test@bidule.com\nls\' \ | ftp -i -n | grep -q welcome'" unsetErrorHandler echoDone return $localErrors }