summaryrefslogtreecommitdiff
path: root/guix/kolwynia/home/bdunahu/files/.local/bin/upload
diff options
context:
space:
mode:
authorbdunahu <bdunahu@operationnull.com>2026-01-04 13:13:39 -0700
committerbdunahu <bdunahu@operationnull.com>2026-01-04 13:13:39 -0700
commitc2b706ff2f3aa42d58a03febad1d1b8f8d5a1142 (patch)
treed6786f531f02717472abdc992cc6c6ef81e660b3 /guix/kolwynia/home/bdunahu/files/.local/bin/upload
parentc4ca05231236c7e9bdf5304275eadde954acf588 (diff)
remove unnecessary nested guix dir
Diffstat (limited to 'guix/kolwynia/home/bdunahu/files/.local/bin/upload')
-rwxr-xr-xguix/kolwynia/home/bdunahu/files/.local/bin/upload43
1 files changed, 0 insertions, 43 deletions
diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/upload b/guix/kolwynia/home/bdunahu/files/.local/bin/upload
deleted file mode 100755
index a2db9b5..0000000
--- a/guix/kolwynia/home/bdunahu/files/.local/bin/upload
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-
-err() { echo "Usage:
- upload [OPTIONS]
-Options:
- -t: time from now to expire in hours (default: 48)
- file: a path to a file. If this is not given, receives input from stdin." && exit 1 ;}
-
-hours=48
-
-while getopts ":t:" opt; do
- case $opt in
- t)
- hours=$OPTARG
- if [[ $OPTARG =~ ^-?[0-9]+$ ]]; then
- hours=$OPTARG
- else
- err
- fi
- ;;
- *)
- err
- ;;
- esac
-done
-
-shift $((OPTIND -1))
-
-if [ -n "$1" ] && [ -f "$1" ]; then
- source="$1"
- ext="${1##*.}"
-else
- source=$(mktemp)
- ext="txt"
- cat > "$source"
- chmod a+r "$source"
-fi
-
-dest="$(cat /dev/random | tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1)-$(date -d "+$hours hours" +%s).$ext"
-
-scp "$source" "root@operationnull.com:/var/www/operationnull/paste/$dest" &&
- echo "https://operationnull.com/paste/$dest"