Bash: ssh-key function.
This commit is contained in:
		| @@ -88,6 +88,10 @@ Get gzipped file size. | ||||
|  | ||||
| Test if HTTP compression (RFC 2616 + SDCH) is enabled for a given URL. Send a fake UA string for sites that sniff it instead of using the Accept-Encoding header. | ||||
|  | ||||
| ### ssh-key | ||||
|  | ||||
| Copy public SSH key to clipboard. Generate it if necessary. | ||||
|  | ||||
| ### add-ssh-host <username> <hostname> <identifier> | ||||
| 	 | ||||
| Create an SSH key and uploads it to the given host. | ||||
|   | ||||
| @@ -80,6 +80,17 @@ function nyan() { | ||||
| 	echo | ||||
| } | ||||
|  | ||||
| # Copy public SSH key to clipboard. Generate it if necessary | ||||
| ssh-key() { | ||||
| 	file="$HOME/.ssh/id_rsa.pub" | ||||
| 	if [ ! -f "$file" ]; then | ||||
| 		ssh-keygen -t rsa | ||||
| 	fi | ||||
| 	 | ||||
| 	cat "$file" | c | ||||
| 	echo "Your public key copied to clipboard." | ||||
| } | ||||
|  | ||||
| # Create an SSH key and uploads it to the given host | ||||
| # Based on https://gist.github.com/1761938 | ||||
| add-ssh-host() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Artem Sapegin
					Artem Sapegin