refactor: generate a randomized paste-name
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -75,7 +75,7 @@ function upload_selection(){
|
|||||||
top_border
|
top_border
|
||||||
echo -e "| ${yellow}~~~~~~~~~~~~~~~ [ Log Upload ] ~~~~~~~~~~~~~~${white} |"
|
echo -e "| ${yellow}~~~~~~~~~~~~~~~ [ Log Upload ] ~~~~~~~~~~~~~~${white} |"
|
||||||
hr
|
hr
|
||||||
echo -e "| You can choose the following files for uploading: |"
|
echo -e "| You can choose the following logfiles for uploading: |"
|
||||||
blank_line
|
blank_line
|
||||||
for log in "${logfiles[@]}"; do
|
for log in "${logfiles[@]}"; do
|
||||||
log=${log//${HOME}/"~"}
|
log=${log//${HOME}/"~"}
|
||||||
@@ -86,7 +86,7 @@ function upload_selection(){
|
|||||||
blank_line
|
blank_line
|
||||||
back_footer
|
back_footer
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}Please select:${white} " option
|
read -p "${cyan}###### Please select:${white} " option
|
||||||
if [ -n "${option}" ] && ((option < ${#logfiles[@]})); then
|
if [ -n "${option}" ] && ((option < ${#logfiles[@]})); then
|
||||||
upload_log "${logfiles[${option}]}"
|
upload_log "${logfiles[${option}]}"
|
||||||
upload_selection
|
upload_selection
|
||||||
@@ -102,7 +102,7 @@ function upload_log(){
|
|||||||
local link
|
local link
|
||||||
clear && print_header
|
clear && print_header
|
||||||
status_msg "Uploading ${1} ..."
|
status_msg "Uploading ${1} ..."
|
||||||
link=$(curl -s --upload-file "${1}" 'http://paste.c-net.org/')
|
link=$(curl -s -H "x-random;" --upload-file "${1}" 'http://paste.c-net.org/')
|
||||||
if [ -n "${link}" ]; then
|
if [ -n "${link}" ]; then
|
||||||
ok_msg "${1} upload successfull!"
|
ok_msg "${1} upload successfull!"
|
||||||
echo -e "\n${cyan}###### Here is your link:${white}"
|
echo -e "\n${cyan}###### Here is your link:${white}"
|
||||||
|
|||||||
Reference in New Issue
Block a user