Added strict option
[lace] / laced
diff --git a/laced b/laced
index a9424b5ca22b1b5b086eaa0f15eceaf1a54c0c9e..ae8c8254ab76528857559fc6cc4ea7954b8a7d6e 100755 (executable)
--- a/laced
+++ b/laced
@@ -21,6 +21,12 @@ red="[31m"
 blue="[34m"
 nc="[m"
 esc=$(echo -e "\033")
+       if [[ "$1" == "strict" ]] || [[ "$1" == "--strict" ]] || [[ "$1" == "-strict" ]] || [[ "$1" == "-s" ]];then
+               red=""
+               blue=""
+               nc=""
+               esc=""
+       fi
 tmpfile=$(mktemp /tmp/lace.XXXXXX)
 tmpfile2=$(mktemp /tmp/lace.XXXXXX)
 function reldate() {
@@ -109,7 +115,15 @@ function timeline() {
        done<$tmpfile
 
        cat $tmpfile2 | sed "s/^\([0-9]* [a-z]* ago\)$/${esc}$blue\1${esc}$nc/g" >$tmpfile
+       wordcount="$(wc -c $tmpfile | awk '{print $1}')"
+       if [[ "$wordcount" > 100 ]]; then
        cp $tmpfile $config_place/microblogs.gmi 
+       else
+               
+sed -i '1i Laced could not connect to the Internet showing previous download' $config_place/microblogs.gmi
+
+       fi
+
 
        rm -f $tmpfile $tmpfile2
        }
@@ -130,7 +144,7 @@ elif [[ "$1" == "unsub" ]];then
 elif [[ "$1" == "subs" ]];then
        awk '{print $2" ("$1")"}' $subsfile 
 elif [[ "$1" == "update" ]];then
-       curl https://raw.githubusercontent.com/frrobert2/lace/main/lace > "${BASH_SOURCE[0]}"
+       curl https://raw.githubusercontent.com/frrobert2/lace/main/laced > "${BASH_SOURCE[0]}"
 else
        now_unix="$(date +'%s')"
                timeline