Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add command to easily update Authy SSH.

Just type `authy-ssh update` to update the program on your server.
  • Loading branch information...
commit 1f064211eec0e56ffb050576a61ca795be036037 1 parent b1941ab
@dcu dcu authored
Showing with 27 additions and 1 deletion.
  1. +26 −0 authy-ssh
  2. +1 −1  authy-ssh.sha1sum
View
26 authy-ssh
@@ -4,6 +4,7 @@ VERSION="1.0"
AUTHY_URL="https://api.authy.com"
APP_ROOT=`dirname $0`
CONFIG_FILE="$APP_ROOT/authy-ssh.conf"
+UPSTREAM_URL="https://raw.github.com/authy/authy-ssh/master/authy-ssh"
export TERM="xterm-256color"
NORMAL=$(tput sgr0)
@@ -435,6 +436,22 @@ function run() {
done
}
+function update_authy() {
+ curl "${UPSTREAM_URL}" -o /tmp/authy-ssh-new
+ chmod 755 /tmp/authy-ssh-new
+
+ echo -n "Do you want to overwrite ${COMMAND} (y/n)? "
+ read opt
+ if [[ "$opt" == "y" ]]
+ then
+ mv /tmp/authy-ssh-new ${COMMAND}
+ green "Now type authy-ssh test to verify everything is working."
+ else
+ rm /tmp/authy-ssh-new
+ yellow "Authy SSH was not updated."
+ fi
+}
+
require_curl
# get the absolute path to the command
@@ -447,6 +464,10 @@ case $1 in
require_root
install_authy $0 $2
;;
+ update)
+ require_root
+ update_authy
+ ;;
uninstall)
require_root
uninstall_authy
@@ -492,6 +513,11 @@ Available commands:
sudo $0 install /usr/local/bin
+ update
+ updates Authy SSH using the main authy-ssh script:
+
+ ${UPSTREAM_URL}
+
uninstall
uninstalls Authy SSH from sshd_config
View
2  authy-ssh.sha1sum
@@ -1 +1 @@
-4761bf0eb3e014df3ddea47d59b25cb299a20383 authy-ssh
+d0166c21f638a82cc34943646d7b5828dc754236 authy-ssh
Please sign in to comment.
Something went wrong with that request. Please try again.