confOS/.config/fish/functions/ssh-export.fish
2023-10-09 17:56:28 +02:00

14 lines
394 B
Fish

function ssh-export --description "Export SSH keys and config to a zip archive."
# Save the entry directory
set entry_directory "$PWD"
# Create the archive
set output_file "$HOME/ssh_keys.zip"
cd "$HOME/.ssh"
zip "$output_file" * -x 'known_hosts*' -x environment
# Returns to the entry directory
cd "$entry_directory"
echo "Exported at $output_file."
end