DEV Community

Cover image for oh-ex-oh: automated uploading and file management

Posted on

oh-ex-oh: automated uploading and file management

As if just curl -F'file=@mystupidfile.png' wasn't simple enough.

This is a basic singular shell script that can take one file as an argument and upload it. Woweee. But it can also save tokens given from the file hoster so you can set an expiry date or manually delete it at a later time after uploading.

This was kind of made to test my hand at full on shell scripting as well because half of the work in this is a custom config reader/writer, option parsing. I haven't tested this other thing yet, but I made it in a way for the host for uploads to be changeable so another 0x0 instance can be used.

Soon, I'll want to get an interface working for this but still in the terminal, and accepting piped input.

Made to be compatible with zsh, so not technically bash, trying for this to be as POSIX as I can without weird hacks.
Tested on Cygwin.

Timelapse of code

Uploading random file (a clip from the Rymdreglage video 8-bit trip)
File uploaded in above example:
(I'm able to reupload the file under the same link if the file stays the same)

Top comments (1)

donnaken15 profile image

who the hell are you people