From 0c50cd2045c83a8538aafd03a6fc814b776297c2 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Thu, 27 Sep 2018 13:24:59 +0300 Subject: [PATCH] get url to copy of self --- code/app.py | 2 +- code/templates/flip | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/app.py b/code/app.py index a324c88..0898867 100644 --- a/code/app.py +++ b/code/app.py @@ -14,7 +14,7 @@ from utils.utils import * from utils.crypt import * -__FLEES_VERSION__ = "20180920.0" +__FLEES_VERSION__ = "20180927.0" app = Flask(__name__) app.config.from_object(__name__) config_values = read_config(app) diff --git a/code/templates/flip b/code/templates/flip index 200a4b5..413b80b 100755 --- a/code/templates/flip +++ b/code/templates/flip @@ -15,6 +15,7 @@ _help() { url Get the direct share url upload Get URL for uploads [no arguments] update Update flip client [no arguments] + self Get URL to install this client to another computer Name: Any string for the clipboard name. default: 0 @@ -128,7 +129,14 @@ _url() { # name } _upload_url() { echo "This information is a security risk, watch where it's shared" - echo "curl -s $FLEES_ROOTURL/script/upload/$FLEES_SHARE/$FLEES_TOKEN | bash /dev/stdin file_to_upload.ext" + echo "# curl -s $FLEES_ROOTURL/script/upload/$FLEES_SHARE/$FLEES_TOKEN | bash /dev/stdin file_to_upload.ext" + exit +} +_self_url() { + SELF=$( basename "$0" ) + echo "This information is a security risk, watch where it's shared!" + echo "" + echo "# curl $FLEES_ROOTURL/script/flip/$FLEES_SHARE/$FLEES_TOKEN -o $SELF && chmod +x $SELF" exit } _msg() { @@ -177,6 +185,7 @@ CMD=list [[ "$1" = "url" ]] && { CMD=url; ARG1=$CMD; } [[ "$1" = "update" ]] && { _update_client; } [[ "$1" = "upload" ]] && { _upload_url; } +[[ "$1" = "self" ]] && { _self_url; } [[ "$1" = "h" || "$1" = "help" ]] && _help [[ "$CMD" = list ]] && {