All pastes #717677 Raw Edit

Unnamed

public text v1 · immutable
#717677 ·published 2007-09-27 20:01 UTC
rendered paste body
#!/bin/bash
hosts_list=/home/admin/files/hosts.txt
remote_user=admin
source_dir=/home/admin/files/
target_dir=/home/admin/

cd "$source_dir"

while read hostname; do
  grep '^[[:space:]]*#' <<<"$hostname" && continue

ssh "${remote_user}@${hostname}" "cat /proc/cpuinfo" >> cpu

done < "$hosts_list"