-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows the install script to be curled directly from GitHub for easy install: curl http://URL/TO/install.sh | sh
- Loading branch information
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
#!/bin/sh | ||
# Installs ssh-copy-id into /usr/local/bin | ||
|
||
cp ssh-copy-id.sh /usr/local/bin/ssh-copy-id; | ||
chmod +x /usr/local/bin/ssh-copy-id; | ||
if [[ $(id -u) != 0 ]]; then | ||
if command -v sudo >/dev/null 2>&1; then | ||
SUDO="sudo" | ||
else | ||
echo >&2 "Requires sudo but it's not installed. Aborting." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
if git ls-files >& /dev/null && [[ -f ssh-copy-id.sh ]]; then | ||
$SUDO cp ssh-copy-id.sh /usr/local/bin/ssh-copy-id || { echo "Failed to install ssh-copy-id into /usr/local/bin."; exit 1; } | ||
else | ||
$SUDO curl -L https://raw.github.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id || { echo "Failed to install ssh-copy-id into /usr/local/bin."; exit 1; } | ||
$SUDO chmod +x /usr/local/bin/ssh-copy-id || { echo "Failed to install ssh-copy-id into /usr/local/bin."; exit 1; } | ||
fi | ||
echo "Installed ssh-copy-id into /usr/local/bin."; exit 0; |