PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
2 sec ago
Untitled
7 sec ago
Untitled
8 sec ago
Untitled
8 sec ago
Untitled
23 sec ago
Untitled
25 sec ago
Untitled
40 sec ago
Untitled
33 sec ago
New Paste
#!/usr/bin/env bash # # Copyright (C) 2009 Benjamin Drung <bdrung at ubuntu dot com> # Copyright (C) 2012 Alessio Sergi <al3hex at gmail dot com> # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. set -e # filled by the PKGBUILD NAME='REPL_NAME' VERSION='REPL_VERSION' LANGUAGE="REPL_LANGUAGE" DIRECTORY=~/.$NAME INSTALL_DIRECTORY=$DIRECTORY/INSTALL VERSION_FILE=$DIRECTORY/VERSION LOG_FILE=$DIRECTORY/LOG ARCH=$(uname -m) DOWNLOAD_URL="https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz" SIG_URL=$DOWNLOAD_URL.asc notify() { local title="$1" local message="$2" if [ $(which zenity 2>/dev/null) ]; then zenity --info --title "$title" --text "$message" elif [ $(which notify-send 2>/dev/null) ]; then notify-send "$title" "$message" elif [ $(which kdialog 2>/dev/null) ]; then kdialog --title "$title" --passivepopup "$message" else echo -e "$0: [$title] $message" >&2 fi } update() { # remove previous installation and archives rm -rf $INSTALL_DIRECTORY/* $DIRECTORY/*.tar.gz $DIRECTORY/*.asc notify "Info" "Downloading and installing package archive, please be patient.\ \nTor-Browser will start automatically afterwards." & echo "$0: Downloading $DOWNLOAD_URL." >> $LOG_FILE wget $DOWNLOAD_URL >> $LOG_FILE 2>&1 || notify "Error" \ "The tor-browser archive could not be downloaded. \ \nCheck your Internet connection and try again. \ \nThe error log can be found in $LOG_FILE." echo "$0: Downloading $SIG_URL" >> $LOG_FILE wget $SIG_URL >> $LOG_FILE 2>&1 || notify "Error" \ "The tor-browser archive signature file could not be downloaded. \ \nCheck your Internet connection and try again. \ \nThe error log can be found in $LOG_FILE." # if [ $(which gpg 2>/dev/null) ]; then # gpg --auto-key-locate x-hkp://pool.sks-keyservers.net \ # --verify tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz.asc \ # tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz \ # >> $LOG_FILE 2>&1 || notify "Warning" \ # "Problems checking the signature of \ # tor-browser-gnu-linux-${ARCH}-${VERSION}.tar.gz. \ # \nEither there was an error retrieving the public key or the signature is incorrect!\ # \nThe log file can be found in $LOG_FILE." # fi tar -xzf tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz -C $INSTALL_DIRECTORY >> $LOG_FILE 2>&1 || notify "Error" \ "Error unpacking tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz. \ \nThe error log can be found in $LOG_FILE." mv $INSTALL_DIRECTORY/tor-browser_${LANGUAGE}/* $INSTALL_DIRECTORY >> $LOG_FILE 2>&1 rm -rf $INSTALL_DIRECTORY/tor-browser_${LANGUAGE}/ tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz tor-browser-gnu-linux-${ARCH}-${VERSION}-${LANGUAGE}.tar.gz.asc >> $LOG_FILE 2>&1 [[ -f $INSTALL_DIRECTORY/start-tor-browser ]] && echo $VERSION > $VERSION_FILE } usage() { cat <<EOF Usage: ${0##*/} [option] Options: -h Show this help message and exit -u Force update -r <directory> The Tor-Browser directory to use EOF } while getopts ':hr:u' opt; do case "$opt" in h) usage; exit 0 ;; r) DIRECTORY="$OPTARG" ;; u) update=1 ;; :) echo "$0: Option '-$OPTARG' requires an argument" >&2 exit 1 ;; *) echo "$0: Invalid option '-$OPTARG'" >&2 usage; exit 1 ;; esac done # create directory, if it is missing (e.g. first run) [[ ! -d "$INSTALL_DIRECTORY" ]] && mkdir -p "$INSTALL_DIRECTORY" cd "$DIRECTORY" # clear log > $LOG_FILE # create version file if missing [[ ! -f $VERSION_FILE ]] && echo 0 > $VERSION_FILE #get installed version while read line do INSTALLED_VERSION=$line done < $VERSION_FILE # start update if old or no tor-browser is installed if [[ "$INSTALLED_VERSION" == "$VERSION" ]] && [[ $update != 1 ]]; then cd $INSTALL_DIRECTORY && './start-tor-browser' else echo "$0: Your version in $DIRECTORY is outdated or you do not have installed $NAME yet." >> $LOG_FILE update # fire up $NAME fi
Optional Paste Settings
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
HTML 5
Java
JavaScript
Lua
None
Objective C
Perl
PHP
Python
Rails
-------------
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
ActionScript
ActionScript 3
Ada
ALGOL 68
Apache Log
AppleScript
APT Sources
ARM
ASM (NASM)
ASP
Asymptote
autoconf
Autohotkey
AutoIt
Avisynth
Awk
BASCOM AVR
Bash
Basic4GL
BibTeX
Blitz Basic
BNF
BOO
BrainFuck
C
C for Macs
C Intermediate Language
C#
C++
C++ (with QT extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
ChaiScript
Clojure
Clone C
Clone C++
CMake
COBOL
CoffeeScript
ColdFusion
CSS
Cuesheet
D
DCL
DCPU-16
DCS
Delphi
Delphi Prism (Oxygene)
Diff
DIV
DOS
DOT
E
ECMAScript
Eiffel
Email
EPC
Erlang
F#
Falcon
FO Language
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
Game Maker
GDB
Genero
Genie
GetText
Go
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9 Plus
HTML
HTML 5
Icon
IDL
INI file
Inno Script
INTERCAL
IO
J
Java
Java 5
JavaScript
jQuery
KiXtart
Latex
LDIF
Liberty BASIC
Linden Scripting
Lisp
LLVM
Loco Basic
Logtalk
LOL Code
Lotus Formulas
Lotus Script
LScript
Lua
M68000 Assembler
MagikSF
Make
MapBasic
MatLab
mIRC
MIX Assembler
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MPASM
MXML
MySQL
Nagios
newLISP
None
NullSoft Installer
Oberon 2
Objeck Programming Langua
Objective C
OCalm Brief
OCaml
Octave
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
ParaSail
PARI/GP
Pascal
PAWN
PCRE
Per
Perl
Perl 6
PHP
PHP Brief
Pic 16
Pike
Pixel Bender
PL/SQL
PostgreSQL
POV-Ray
Power Shell
PowerBuilder
ProFTPd
Progress
Prolog
Properties
ProvideX
PureBasic
PyCon
Python
Python for S60
q/kdb+
QBasic
R
Rails
REBOL
REG
Rexx
Robots
RPM Spec
Ruby
Ruby Gnuplot
SAS
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
SPARK
SPARQL
SQL
StoneScript
SystemVerilog
T-SQL
TCL
Tera Term
thinBasic
TypoScript
Unicon
UnrealScript
UPC
Urbi
Vala
VB.NET
Vedit
VeriLog
VHDL
VIM
Visual Pro Log
VisualBasic
VisualFoxPro
WhiteSpace
WHOIS
Winbatch
XBasic
XML
Xorg Config
XPP
YAML
Z80 Assembler
ZXBasic
Paste Expiration:
Never
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
Paste Exposure:
Public
Unlisted
Private (members only)
Paste Name / Title:
Hello
Guest
Sign Up
or
Login
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login