dotfiles

my dotfiles
Log | Files | Refs

commit 5e703734fa3cca6644f25873a7302143236dbf44
parent 2ab3ac2a321ad8e83f9fb32174bd69b9a46da16d
Author: tin <ichtinnotl@gmail.com>
Date:   Mon, 26 Nov 2018 00:53:03 +0100

adds publish shell script

Diffstat:
.scripts/publish.sh | 30++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+), 0 deletions(-)

diff --git a/.scripts/publish.sh b/.scripts/publish.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +pub='pub' +prv='prv' + +transfer() { + scp -P 1984 "$3" root@lh.mk:/var/www/htdocs/"$1".lh.mk/"$2"; + clear; + echo Link: https://"$1".lh.mk/"$2"/"$3" copied to clipboard.; + echo https://"$1".lh.mk/"$2"/"$3" | xclip -selection clipboard +} + +usage() { + echo "Usage:"; + echo "publish prv [ptch | rnd | sh | tmp | txt] <file>"; + echo "publish pub [keys | mixes | papers | prezentacii | random] <file>"; + exit 1; +} + +if [ $# -eq 3 ] +then + if [[ $1 = $prv || $1 = $pub ]] + then + transfer "$1" "$2" "$3"; + else + usage; + fi +else + usage; +fi