summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2015-03-23 15:47:03 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2015-03-23 15:47:03 +0100
commita6229a3c6079ca8d4a26665cfe9ae24e3e95bfec (patch)
tree0b4369d60d485f5506bc434ac3636ec2badfec9d
parent49c06d173d70f6b29f94c3357d2155c0769c0077 (diff)
downloaddotfiles-a6229a3c6079ca8d4a26665cfe9ae24e3e95bfec.tar.gz
dotfiles-a6229a3c6079ca8d4a26665cfe9ae24e3e95bfec.tar.bz2
dotfiles-a6229a3c6079ca8d4a26665cfe9ae24e3e95bfec.zip
functions: re-enable the up() function
-rw-r--r--.config/bash/functions.sh31
1 files changed, 16 insertions, 15 deletions
diff --git a/.config/bash/functions.sh b/.config/bash/functions.sh
index 786e199..9f04f70 100644
--- a/.config/bash/functions.sh
+++ b/.config/bash/functions.sh
@@ -76,10 +76,6 @@ start() {
bash -c "source ~/.bashrc.functions; ${@} >> /dev/null 2>&1"
}
-ts() {
- start /opt/bin/TeamSpeak $@
-}
-
eworld() {
local packages=$(/usr/bin/eix -u --only-names)
[[ -n $packages ]] && /usr/bin/sudo /usr/bin/emerge --verbose --ask --update --oneshot $packages
@@ -103,26 +99,31 @@ tstart() {
}
up() {
- local server=netdirekt
+ local server=bnfr.net
- if [[ -f $1 ]]; then
- local rand=`date +%s | md5sum | sed -n 's/^\(...\).*$/\1/p'`
+ if [[ -f $1 ]]; then
+ local rand=`date +%s | md5sum | sed -n 's/^\(.....\).*$/\1/p'`
local r="${rand}"
local s=`basename $1`
+ [[ -n $2 ]] && s="$2"
+
local name="$r-$s"
+ local nicename="$r/$s"
# local name="${rand}-`basename $1`"
- scp -q $1 $server:"/home/benjamin/uploads/${name}" || exit
+ scp -q $1 $server:"/home/ben/htdocs/uploads/${name}" || exit
+
+ #local cmd="sudo chown lighttpd:lighttpd /home/benjamin/uploads/${name}"
+ #ssh -q $server $cmd || exit
- local cmd="sudo chown lighttpd:lighttpd /home/benjamin/uploads/${name}"
- ssh -q $server $cmd || exit
+ local url="https://bnfr.net/~ben/uploads/${nicename}"
- local ext=$(echo $1 | sed "s/^.*\.\([^\.]*\)$/\\1/")
- local types="dummy txt $(sed -n "s/^\$ext(\(.*\))=\(.*\)$/\\1 \\2/p" /etc/highlight/filetypes.conf) dummy"
+ #local ext=$(echo $1 | sed "s/^.*\.\([^\.]*\)$/\\1/")
+ #local types="dummy txt $(sed -n "s/^\$ext(\(.*\))=\(.*\)$/\\1 \\2/p" /etc/highlight/filetypes.conf) dummy"
- [[ -n $(echo $types | grep " $ext ") ]] && \
- local url="http://89.149.199.86/highlight/${name}" || \
- local url="http://89.149.199.86/file/$r/$s"
+ #[[ -n $(echo $types | grep " $ext ") ]] && \
+ #local url="http://89.149.199.86/highlight/${name}" || \
+ #local url="http://89.149.199.86/file/$r/$s"
echo -n $url | xclip -selection clipboard
echo -n $url | xclip -selection primary