mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Partially commenting qrify
This commit is contained in:
parent
7656e970de
commit
8bf97b8382
10
qrify/qrify
10
qrify/qrify
@ -2,7 +2,7 @@
|
|||||||
# Author: Linyos Torovoltos github.com/linyostorovovoltos
|
# Author: Linyos Torovoltos github.com/linyostorovovoltos
|
||||||
|
|
||||||
currentVersion="1.10.1"
|
currentVersion="1.10.1"
|
||||||
multiline="0"
|
multiline="0" # flag that indicates multiline option
|
||||||
|
|
||||||
|
|
||||||
getConfiguredClient()
|
getConfiguredClient()
|
||||||
@ -68,13 +68,13 @@ httpGet()
|
|||||||
|
|
||||||
makeqr()
|
makeqr()
|
||||||
{
|
{
|
||||||
input=$(echo $input | sed s/" "/%20/g )
|
input=$(echo $input | sed s/" "/%20/g ) ## replace all spaces in the sentence with HTML encoded space %20
|
||||||
httpGet qrenco.de/$input
|
httpGet qrenco.de/$input ## get a response for the qrcode
|
||||||
}
|
}
|
||||||
|
|
||||||
makeMultiLineQr()
|
makeMultiLineQr()
|
||||||
{
|
{
|
||||||
if [[ $configuredClient != "curl" ]]; then
|
if [[ $configuredClient != "curl" ]]; then ## prevent usage without curl it is unreliable
|
||||||
echo "Multiline currently only supports curl!"
|
echo "Multiline currently only supports curl!"
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
@ -132,7 +132,7 @@ else
|
|||||||
makeqr || exit 1
|
makeqr || exit 1
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
makeMultiLineQr "${@:2}" || exit 1
|
makeMultiLineQr "${@:2}" || exit 1 ## if multiline that means a flag existed so start from the second argument
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user