Passwords for files

This commit is contained in:
Q
2023-08-20 22:23:42 +03:00
parent 80bce10987
commit 9af21b5f58
7 changed files with 103 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ _help() {
-d max days to keep (default 30)
-m max downloads to keep (default 9999, -1 to disable)
-p password
Filename:
When writing to share:
@@ -105,6 +106,7 @@ _write_folder() { # name, file
-H "Max-Downloads: $MAXDL" \
-H "Expires-Days: $MAXDAYS" \
-H "Secret: $MFL_TOKEN" \
-H "Password: $PASSWORD" \
"$MFL_ROOTURL"/upload | cat
}
_write_file() { # name, file
@@ -113,6 +115,7 @@ _write_file() { # name, file
-H "Max-Downloads: $MAXDL" \
-H "Expires-Days: $MAXDAYS" \
-H "Secret: $MFL_TOKEN" \
-H "Password: $PASSWORD" \
"$MFL_ROOTURL"/upload | cat
}
_write_stdin() { # name
@@ -122,6 +125,7 @@ _write_stdin() { # name
-H "Max-Downloads: $MAXDL" \
-H "Expires-Days: $MAXDAYS" \
-H "Secret: $MFL_TOKEN" \
-H "Password: $PASSWORD" \
"$MFL_ROOTURL"/upload | cat
}
@@ -200,6 +204,7 @@ for (( i=2; i<=$#; i++ )); do
j=$(( i + 1 ))
[[ "${!i}" = "-m" ]] && { MAXDL=${!j}; i=$j; continue; }
[[ "${!i}" = "-d" ]] && { MAXDAYS=${!j}; i=$j; continue; }
[[ "${!i}" = "-p" ]] && { PASSWORD=${!j}; i=$j; continue; }
if [[ -z "$FILE" ]]; then
FILE="${!i}"
continue