Commit a8e8ba60 authored by Bernhard Landauer's avatar Bernhard Landauer

[deployiso] add ssh-agent support

parent 084ef426
......@@ -56,6 +56,7 @@ display_settings(){
msg2 "account: %s" "${account}"
msg2 "host: %s" "${host}"
msg2 "alt_storage: %s" "${alt_storage}"
msg2 "ssh_agentt: %s" "${ssh_agent}"
msg "UPLOAD QUEUE:"
run show_profile "${build_list_iso}"
......
......@@ -57,6 +57,9 @@
# the server user
# account=[SetUser]
# Set to 'true' to use ssh-agent to store passphrase.
# ssh_agent=false
# use alternative storage server (one or the other might be more stable)
# alt_storage=false
......
......@@ -42,6 +42,27 @@ prepare_transfer(){
${hidden} && target_dir="${profile}/.${dist_release}"
}
start_agent(){
msg2 "Initializing SSH agent..."
ssh-agent | sed 's/^echo/#echo/' > "$1"
chmod 600 "$1"
. "$1" > /dev/null
ssh-add
}
ssh_add(){
local ssh_env="$USER_HOME/.ssh/environment"
if [ -f "${ssh_env}" ]; then
. "${ssh_env}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent ${ssh_env};
}
else
start_agent ${ssh_env};
fi
}
sync_dir(){
cont=1
max_cont=10
......@@ -49,6 +70,7 @@ sync_dir(){
${torrent} && make_torrent
${sign} && signiso "${src_dir}"
${ssh_agent} && ssh_add
msg "Start upload [%s] to [%s] ..." "$1" "${project}"
while [[ $cont -le $max_cont ]]; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment