aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-14 20:05:05 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-14 20:05:05 +0000
commitf620526e38f9f550dec2ca174085ab9f67f687a4 (patch)
tree43015cd238211da49e22567d27d980f2161e039b /bin
parent5bc93e78a6bc0bedd909d8ee79ea0c86aa00f02b (diff)
downloadrgoncalves.se-f620526e38f9f550dec2ca174085ab9f67f687a4.tar.gz
bin/rssg: Add Linux switch for sha256 sum
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rssg7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/rssg b/bin/rssg
index 59f0797..f153b0e 100755
--- a/bin/rssg
+++ b/bin/rssg
@@ -5,6 +5,7 @@
set -e
current_date=$(date +"%a, %d %b %Y %H:%M:%S %z")
+uname=$(uname)
cat <<-EOF > "${rss_out_file}"
<rss version="2.0">
@@ -27,7 +28,11 @@ for file in $(__list_files_date "${rss_dir}"); do
title=$(__get_value_title "${file}")
date=$(__get_value_date_publication "${file}")
link="${website_link}/$(__get_final_filename ${file})"
- guid="$(echo ${link} | sha256)"
+ if [ "${uname}" = "Linux" ]; then
+ guid="$(echo ${link} | sha256sum)"
+ else
+ guid="$(echo ${link} | sha256)"
+ fi
cat <<-EOF >> "${rss_out_file}"
<item>
remember that computers suck.