|
|
|
@ -75,14 +75,14 @@ fi
@@ -75,14 +75,14 @@ fi
|
|
|
|
|
|
|
|
|
|
if [[ -n "${input}" ]]; then |
|
|
|
|
output=$(curl --silent --data "${querystring}" --data-urlencode "code=${input}" https://api.teknik.io/v1/Paste) |
|
|
|
|
pasteid=$(grep -Eo '"id":[0-9]+' <<< "${output}" | sed 's/\\//g') |
|
|
|
|
pasteid="${pasteid##\"id\":}" |
|
|
|
|
pasteid=$(grep -Eo '"id":"[0-9a-zA-Z]+' <<< "${output}" | sed 's/\\//g') |
|
|
|
|
pasteid="${pasteid##\"id\":\"}" |
|
|
|
|
if [[ -n "${pasteid}" ]]; then |
|
|
|
|
[[ -n "${title}" ]] && printf "Title Specified: ${title}\n" |
|
|
|
|
[[ -n "${expiry}" ]] && printf "Expiration Specified: ${expiry}\n" |
|
|
|
|
[[ -n "${format}" ]] && printf "Paste Format Specified: ${format}\n" |
|
|
|
|
[[ -n "${password}" ]] && printf "Paste is password protected!\n" |
|
|
|
|
printf "Your paste can be found at https://p.teknik.io/${pasteid}\n" |
|
|
|
|
printf "Your paste can be found at https://paste.teknik.io/${pasteid}\n" |
|
|
|
|
exit 0 |
|
|
|
|
else |
|
|
|
|
printf "There was an error submitting your paste! We are sorry." |
|
|
|
|