Something went wrong. Try again.
Dotfiles for my macos setup
Something went wrong. Try again.
967 B · 33 lines
at main
12345678910111213141516171819202122232425262728293031323334#!/bin/bash# quit on errorset -e# requirements: curl, fzf# optional requirements: age (for encryption)file=$1if [ -z "$file" ]; then file=$(fzf --prompt="Select the file which you want to upload" | awk '{ print $1; }') if [ -z "$file" ]; then echo No file was selected. exit fielif [ $# -gt 1 ]; then echo Too many arguments provided. exitfiread -p "Do you want to encrypt the file? [y/N] " -n 1 -rechoif [[ $REPLY =~ ^[Yy]$ ]]; then age -p "$file" >"$file".age file=$file.age echo For decryption use the following command: echo age -d "$file".age >"$file"fidays=$(echo -e 1\\n7\\n14 | fzf --prompt="For how many days do you want to store the file?" | awk '{ print $1; }')downloads=$(echo -e 1\\n2\\n5\\n10\\n20\\n100 | fzf --prompt="How many downloads are you allowing?" | awk '{ print $1; }')curl -H "Max-Downloads: $downloads" -H "Max-Days: $days" --upload-file "$file" https://transfer.sh/