#!/bin/sh set -eux cd "${0%/*}/../.." FLATPAK_ID="${1:-org.cockpit_project.CockpitClient}" # We need to setup an entry in the ssh config, but this is difficult: # if this script is run by a normal user then they probably already # have their own configuration, and we need to be careful not to change # that. if mkdir ~/.ssh; then # ~/.ssh didn't exist yet. Assume that we're safe to configure this. echo 'Include cockpit-client-test.config' > ~/.ssh/config trap 'rm -rf ~/.ssh' EXIT INT QUIT PIPE else # There's already a ~/.ssh directory. Don't modify that, but check it. if ! grep -q 'Include cockpit-client-test.config' ~/.ssh/config; then echo 'Please add "Include cockpit-client-test.config" to your ssh config' exit 1 fi fi rm -f cockpit-client-test-*-*-* cat > ~/.ssh/cockpit-client-test.config <