Use https and a few other improvements

main
Thomas Ba. 9 years ago
parent 2a07bccc3d
commit 5c88a34e96

@ -2,17 +2,17 @@
# PKGBUILD for ArchLinux # PKGBUILD for ArchLinux
pkgname=paste42 pkgname=paste42
pkgver=20110621.1 pkgver=20161108.1
pkgrel=1 pkgrel=1
pkgdesc="Utility to post text files to paste42.de using curl" pkgdesc="Utility to post text files to paste42.de using curl"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="http://paste42.de/" url="https://paste42.de/"
license=('GPL') license=('GPL')
depends=('curl' 'bash') depends=('curl' 'bash')
makedepends=('git') makedepends=('git')
source=() source=()
_gitroot="git://thomasba.de/paste42.git" _gitroot="git://git.thomasba.de/paste42.git"
_gitname="paste42" _gitname="paste42"
build() { build() {
@ -28,6 +28,8 @@ build() {
fi fi
msg "GIT checkout done or server timeout" msg "GIT checkout done or server timeout"
}
install -D -m755 ${_gitname}.sh ${pkgdir}/usr/bin/${_gitname} || return 1 package() {
install -D -m755 "${srcdir}/${_gitname}/${_gitname}.sh" "${pkgdir}/usr/bin/${_gitname}" || return 1
} }

@ -3,15 +3,13 @@
# paste42.sh [-s] [-t "filetype"] [-l] [-h] [-u] file # paste42.sh [-s] [-t "filetype"] [-l] [-h] [-u] file
# Variablen initialisieren & defaults setzen # Variablen initialisieren & defaults setzen
VERSION="20110621.1" VERSION="20161108.1"
ATTR='' ATTR=''
OPTS=""
EXP='0'
TYPE="text" TYPE="text"
TYPES="4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada algol68 apache applescript apt_sources asm asp autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl bf bibtex blitzbasic bnf boo caddcl cadlisp cfdg cfm chaiscript cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt csharp css cuesheet dcs delphi diff div dos dot d ecmascript eiffel email epc e erlang euphoria f1 falcon fo fortran freebasic fsharp gambas gdb genero genie gettext glsl gml gnuplot go groovy gwbasic haskell hicest hq9plus html4strict html5 icon idl ini inno intercal io java5 java javascript j jquery kixtart klonec klonecpp latex lb lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic matlab mirc mmix modula2 modula3 mpasm mxml mysql newlisp nsis oberon2 objc objeck ocaml-brief ocaml oobas oracle11 oracle8 oxygene oz pascal pcre perl6 perl per pf php-brief php pic16 pike pixelbender pli plsql postgresql povray powerbuilder powershell proftpd progress prolog properties providex purebasic pycon python qbasic q rails rebol reg robots rpmspec rsplus ruby sas scala scheme scilab sdlbasic smalltalk smarty sql systemverilog tcl teraterm text thinbasic tsql typoscript unicon uscript vala vbnet vb verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch xbasic xml xorg_conf xpp yaml z80 zxbasic" TYPES="4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada algol68 apache applescript apt_sources asm asp autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl bf bibtex blitzbasic bnf boo caddcl cadlisp cfdg cfm chaiscript cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt csharp css cuesheet dcs delphi diff div dos dot d ecmascript eiffel email epc e erlang euphoria f1 falcon fo fortran freebasic fsharp gambas gdb genero genie gettext glsl gml gnuplot go groovy gwbasic haskell hicest hq9plus html4strict html5 icon idl ini inno intercal io java5 java javascript j jquery kixtart klonec klonecpp latex lb lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic matlab mirc mmix modula2 modula3 mpasm mxml mysql newlisp nsis oberon2 objc objeck ocaml-brief ocaml oobas oracle11 oracle8 oxygene oz pascal pcre perl6 perl per pf php-brief php pic16 pike pixelbender pli plsql postgresql povray powerbuilder powershell proftpd progress prolog properties providex purebasic pycon python qbasic q rails rebol reg robots rpmspec rsplus ruby sas scala scheme scilab sdlbasic smalltalk smarty sql systemverilog tcl teraterm text thinbasic tsql typoscript unicon uscript vala vbnet vb verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch xbasic xml xorg_conf xpp yaml z80 zxbasic"
pw=0 pw=0
trap 'stty echo;exit 1;' 3 9 15 trap 'stty echo;exit 1;' 3 15
usage() { usage() {
echo "Usage:" echo "Usage:"
@ -38,7 +36,7 @@ filetypes() {
} }
checkUpdate() { checkUpdate() {
SERV_VER=$(curl -s -S 'http://git.thomasba.de/cgit/paste42/plain/paste42.sh' | sed -e '/^VERSION=.*/ !d;s/VERSION="\(.*\)"/\1/') SERV_VER=$(curl -s -S 'https://git.thomasba.de/cgit/paste42/plain/paste42.sh' | sed -e '/^VERSION=.*/ !d;s/VERSION="\(.*\)"/\1/')
if [ "$SERV_VER" != "$VERSION" ] ; then if [ "$SERV_VER" != "$VERSION" ] ; then
echo "Update available!" echo "Update available!"
echo "Your version: $VERSION" echo "Your version: $VERSION"
@ -61,10 +59,10 @@ while getopts pst:lhue: opt ; do
l) filetypes;exit;; l) filetypes;exit;;
u) checkUpdate;exit;; u) checkUpdate;exit;;
p) pw=1;; p) pw=1;;
e) ATTR=$ATTR' -d exp='$(echo $OPTARG|sed -e 's/[^0-9:\.a-zA-Z ,]//g');; e) ATTR=$ATTR' -d exp='"${OPTARG//[^0-9:\.a-zA-Z ,]/}";;
esac esac
done done
shift $(expr $OPTIND - 1) shift $((OPTIND - 1))
# wenn dateiname leer ist, beenden # wenn dateiname leer ist, beenden
if [ -z "$1" ] ; then if [ -z "$1" ] ; then
@ -73,7 +71,7 @@ if [ -z "$1" ] ; then
fi fi
# wenn datei nicht existiert oder nicht lesbar ist, suizid # wenn datei nicht existiert oder nicht lesbar ist, suizid
if [ ! -f "$1" -o ! -r "$1" ] ; then if [ ! -f "$1" ] || [ ! -r "$1" ] ; then
echo "File \"$1\" not readable!" >&2 echo "File \"$1\" not readable!" >&2
exit 1 exit 1
fi fi
@ -81,7 +79,7 @@ if [ ! -s "$1" ] ; then
echo "File is empty!" >&2 echo "File is empty!" >&2
exit 1 exit 1
fi fi
if [ -b "$1" -o -c "$1" -o -S "$1" -o -d "$1" ] ; then if [ -b "$1" ] || [ -c "$1" ] || [ -S "$1" ] || [ -d "$1" ] ; then
echo "\"$1\" is no ordinary file!" echo "\"$1\" is no ordinary file!"
exit 1 exit 1
fi fi
@ -98,14 +96,14 @@ if [ $pw -eq 1 ] ; then
while [ ! "$password" = "$password2" ] ; do while [ ! "$password" = "$password2" ] ; do
if [ ! "$password" = "" ] ; then echo "The passwords didn't match." ; fi if [ ! "$password" = "" ] ; then echo "The passwords didn't match." ; fi
echo -ne " Password: " echo -ne " Password: "
stty -echo ; read password ; stty echo stty -echo ; read -r password ; stty echo
echo -ne "\n Repeat the password: " echo -ne "\n Repeat the password: "
stty -echo ; read password2 ; stty echo stty -echo ; read -r password2 ; stty echo
echo "" echo ""
done done
fi fi
filename=`basename $1` filename=$(basename "$1")
# und die daten absenden. # und die daten absenden.
curl -s -S --data-urlencode "del=$password" -d "title=curl paste of $filename" $ATTR -d "type=$TYPE" --data-urlencode "text@$1" 'http://paste42.de/save' curl -s -S --data-urlencode "del=$password" -d "title=curl paste of $filename" $ATTR -d "type=$TYPE" --data-urlencode "text@$1" 'https://paste42.de/save'

Loading…
Cancel
Save