Initial commit (I feel unsafe)
This commit is contained in:
22
homepage_server-geticon
Normal file
22
homepage_server-geticon
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=homepage_server-env
|
||||
. "${HOME}"/"${USER}"-env
|
||||
|
||||
base_url=https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons
|
||||
|
||||
svg_url=${base_url}/svg/${1}.svg
|
||||
png_url=${base_url}/png/${1}.png
|
||||
|
||||
if ! curl -I "${svg_url}" | grep -E "HTTP/.* 404" >/dev/null; then
|
||||
curl -Ss -O --output-dir "${VOLUME_PATH}"/icons "${svg_url}"
|
||||
echo "svg"
|
||||
exit 0
|
||||
elif ! curl -I "${png_url}" | grep -E "HTTP/.* 404" >/dev/null; then
|
||||
curl -Ss -O --output-dir "${VOLUME_PATH}"/icons "${png_url}"
|
||||
echo "png"
|
||||
exit 0
|
||||
else
|
||||
echo "Not Found"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user