File tmate-slave-gen-keys.sh of Package tmate-slave

#!/bin/sh
APP_ARG_KEYSDIR="/etc/tmate-slave/keys"

gen_key() {
  keytype=$1
  ks="${keytype}_"
  key="$APP_ARG_KEYSDIR/ssh_host_${ks}key"
  if [ ! -e "${key}" ] ; then
    ssh-keygen -t ${keytype} -f "${key}" -N ''
    return $?
  fi
}

gen_key dsa && \
gen_key rsa && \
gen_key ecdsa || \
  exit 1

chmod 400 $APP_ARG_KEYSDIR/*key

openSUSE Build Service is sponsored by