root detection functions
This commit is contained in:
		
							parent
							
								
									aab99cccc1
								
							
						
					
					
						commit
						c1ed52ede0
					
				@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user