diff --git a/remote_updater.sh b/remote_updater.sh index 08f04cc..4c6c171 100755 --- a/remote_updater.sh +++ b/remote_updater.sh @@ -26,6 +26,23 @@ show_ssh_hosts () { fi } +is_root () { + echo "test root" + echo "$(id -u)" + return $(id -u) +} + +remote_update () { + echo $1 +ssh $1 << EOF +# date +# hostname +# cat /etc/resolv.conf + $(typeset -f is_root) + is_root +EOF +} + #for i in "${targets[@]}" #do # : @@ -72,6 +89,7 @@ elif [ "$((HOST-OFFSET_OPTIONS))" -gt 7 ]; then else index=$((HOST-OFFSET_OPTIONS)) echo "${TARGETS[$index]}" + remote_update "${TARGETS[$index]}" fi done