diff --git a/TXT/SHA256SUM b/TXT/SHA256SUM new file mode 100644 index 0000000..3f7f8cb --- /dev/null +++ b/TXT/SHA256SUM @@ -0,0 +1,5 @@ +859693698852e9cfca70bec70df019e120b92b755a0ebba46364b7e2ca6d0720 myW02.tar.xz.asc +58c63129b5bbbc510f02eeae4509ecb357667a8b32dbe14bac35ff492f258f86 mylog.txt +6a325867a9b6978dd56e10e7be4ce0921b5788afeb7613fa099e30a0ef7d28e5 mypubkey.txt +fe137bf651e7374db02c4358b4b12c23219cf445bd59f993d9f4d58d85e257fb myupdate.txt +7b814e86025f174fec9e2eaaffdeb8fd3ebf0ce07a4b6d9ea7d33f60057922e3 myscript.sh diff --git a/TXT/SHA256SUM.asc b/TXT/SHA256SUM.asc new file mode 100644 index 0000000..2eb13bc --- /dev/null +++ b/TXT/SHA256SUM.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEMGFet3rQ3AfM7x4Tle5DWiejFo8FAmUAUHYACgkQle5DWiej +Fo9jvQ//Yy/u6Rarb1wzYnUfbPUAMbh6dF7yyNrVFrS0Ddcndc859L+Sys3N/6Vj +LM9oMXdYxD0xuNil5YUUWU3iVpfNk75SzssdW+KhG4XK0r8JPP61wYZrRtQa7Az6 +flQiO9bsDVN8gtIWfMOiHhxcE/UrnRV9JSKMjZ5wwD+luCBwokuM/9SkIRAaw8h2 +VD5cggL/yzWth2w7T7VkJUkJqH5tBN60j/m+3s4X5HIwa8AUl2veI5bjIHHpyg4c +OzqUqX1GPtC/QzEnKd6rUHU/F5FvqSz506R69fYRvJcmmPAaudBd/vKJMheVZwrq +k2tSgjuZuULO3tqaMo6LlvX+4U4mCzJQN6FfslafbKJo/48lPU+A+bdUBy5HvT+2 +OgQYxFwj26dmWUOwVjtkFFgnobhAkfqYDdZfe2xZNyaUk5UeSd+6YCeKOUIq4Jko +7pWL61R+dEKxrx4r6BAZx1xbNVkVCqjmyZ1oy3G+3cFm6bFwk79nBmVqB/pFpxqt +8Rdi8xI/fePnkKdCydOj+qqacafKx1BxlOSLfSRfctzmEMTl6+SK4r5cdtsSX46o +TOsGX1AFXqszIPxVahWVGk7TvnuLD4rIfevemJI/R/Dq5JimYQryDFMhuZEAjXs3 +GKEWIaNUYVsQA0yTwKFto3YjRvO82i3tOwlGeh18lWzg4r5w45A= +=EBQU +-----END PGP SIGNATURE----- diff --git a/TXT/myW02.tar.xz.asc b/TXT/myW02.tar.xz.asc new file mode 100644 index 0000000..53eae47 --- /dev/null +++ b/TXT/myW02.tar.xz.asc @@ -0,0 +1,49 @@ +-----BEGIN PGP MESSAGE----- + +hQIMA85XMajSEcJDARAAm3ZvxQW1soFv4FOQCl7z5GZ8xXo2uPfXvK/5BjyWv8Zn +nHesj2+5Xda1tmj20mDFzmQsivYWh9kE2XFwgw1iIVssGiLlBeTjTIDDdGe2IrEh +tsQfv8caMmp/YmnVEfqjOy3gmWr9BuMUzK4sROiOvG5uCZVekDqf7wv11SO1YK+9 +7xB0fxMro8PloTjr0k223WAI65rT+TfaqpRdRT3CwZAz47xRzmFzzf1TTLghzYL4 +8H6VMnzif6XJohj8McL4GvsQVb5pitsZomG9iyDhWH9F6fl9263oAfcZOeotdGSx +LO52XfgDFTryAAOdlsxpN7/OITX7SroB19UwEU36Yqi7NElLmU7F+RwopCJ/Hbul +uUUggX9wqQ6zw9imxaeD0aoW3v4UGpXUpVX3b+R10T6nA7WlTa87/pk4cP5E9JF0 +DMtixKzf6UX6J14dFhmQJ5id5v9G++oNj1lhKZ/6FPWGmTZeLRczqaRR+67V+xN6 +msnuIMVJ2wUz1+Nlbrj40CZYfiKu7cd/voWBuosQk2umR+Q2LnXQJHNG79eoDo9Y +mHVjmPBjMFMbe7c7gSPYmoQzXQBEmbH+k53cS/8nTW25uL8gAl0V7hg7tgoEGnlz +WnhS4E7VZNkDbhBpXwDIrHntlOc0Pc46N+bfQSqPKDoMsaxcxs32iTp+10WndNuF +AgwDW/S1qoOa5tQBD/49BHA7aDcA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GP MESSAGE----- diff --git a/TXT/mylog.txt b/TXT/mylog.txt index b61f601..62074a2 100644 --- a/TXT/mylog.txt +++ b/TXT/mylog.txt @@ -23,4 +23,7 @@ ZCZC W01 60 L11 Assignment #01 ZCZC W01 20 L12 Assignment #02 ZCZC W01 20 L13 Assignment #03 ZCZC W01 10 L14 Assignment #04 - +ZCZC W02 80 L11 Assignment #01 +ZCZC W02 40 L12 Assignment #02 +ZCZC W02 20 L15 Assignment #05 +ZCZC W02 20 L16 Assignment #06 diff --git a/TXT/mypubkey.txt b/TXT/mypubkey.txt new file mode 100644 index 0000000..f635393 --- /dev/null +++ b/TXT/mypubkey.txt @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGUAR/8BEADqDqzWqGPeop0VOMVZxMYVOX+7+IKJvKYFCYHogqiOYF3TR3c4 +2zjTk0/aICc2+fpl1CBJ8AYbozfvfnHAwMn3R0rBc11bV/ruMMPyI7QK0U2+6f2x +k1Egiwkpmy2mA7Vu7L9McBVDEGyCxByUubPT0dqupjfvMkzcziZq1THFGunsewF5 +/q52zrr6yMPIPAsLacu3RR2yJBqx/3wU+04Lnjc8Yk+HM+yjVpq4mU52e7EwlQlU +V8edvfTV/X463GTBJe/D3zhtzLag+AOTyafBFm5UbFIijy5nZIJM895bcl1aEHm4 +TIGu333dRdi6TqJY7Okd45aSQnub4JEhnKRC3LjkLDcG38Z6/eKjWWOpxKUlTIjC +vrNj2OozUfifPxEWe2Mb2jG+GJyXpZfCPDYmYXcGuBPmrcw1ha+1VhKbF+sV4d9O +cpYBoPE1cWyS0Vd1dyaSwLC36s6aynr7Gbf4Xh54q3GpOeebPfpUQ6i5Qr8oPMe/ +NNLJsZx5G0G5UPY6XtVmbQlZ03Mpdypw7YNklnWPQdjLQjtLOOCAXcTMeqI9p1RT +/MEkEC7GC0jGrD7OKqWlpV9MY7et2yAIy5O6x6t3m65KorhTs9yoslPE49j7PXlu +9QlOz/ZYqT0LbnO7QyDpE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1dNVv/eGCzWPQisHG +ih419FeiEJJTIQTejm+UatTcCamRn9szywSQrgwuXHp2qnS5bgFJvpbsHO/Id0C+ +SjL1xRn9Md6TLfqTUSongDrIHjCwQgD2kt0+UxMGW5hjETy+INHVFfGX8TDSNgA6 +MqmGIFQ3GmGi5oqPOJUOW9PtA2PA7V7N9OFUGsSC3lXX6L5WH4GkraTjXTzLh1Oy +h/Ah2kNAPb4FWHCn280ROGCQSrFjcoBvYx47ABuKVZRsNyXmIj+uk8QnEyrZBO6Q +LxErJxwUdprotrvEEwBRVPTGjLGWgx4X +=XDof +-----END PGP PUBLIC KEY BLOCK----- diff --git a/TXT/myscript.sh b/TXT/myscript.sh new file mode 100644 index 0000000..6759e6e --- /dev/null +++ b/TXT/myscript.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# Copyright (C) 2020-2023 Cicak Bin Kadal + +# This free document is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# REV33: Mon 11 Sep 2023 17:00 +# REV29: Mon 13 Feb 2023 13:30 +# REV19: Sun 05 Feb 2023 20:00 +# REV11: Sun 08 May 2022 06:00 +# REV02: Sun 19 Sep 2021 15:00 +# START: Mon 28 Sep 2020 21:00 + +# ATTN: +# You new to set "REC2" with your own Public-Key Identity! +# Check it out with "gpg --list-key" +# ####################### Replace REC2 #### +REC2="95EE435A27A3168F" +# ####################### ####### #### #### +# REC1: public key +REC1="63FB12B215403B20" +# WEEKURL="http://localhost:4000/WEEK/WEEK.txt" +WEEKURL="https://os.vlsm.org/WEEK/WEEK.txt" +FILES="my*.asc my*.txt my*.sh" +SHA="SHA256SUM" +RESDIR="$HOME/RESULT/" +usage() { echo "Usage: $0 [-w ]" 1>&2; exit 1; } +nolink() { echo "No LINK $1" 1>&2; exit 1; } + +# Check current WEEK +unset WEEK DEFAULT +if [ ! -z "${1##*[!0-9]*}" ] ; then + WEEK=$1 +elif [ -z $1 ] ; then + DEFAULT=1 +else while getopts ":w:W:" varTMP + do + case "${varTMP}" in + w|W) + WEEK=${OPTARG} + [ ! -z "${WEEK##*[!0-9]*}" ] || usage ;; + esac + done + [ -z $WEEK ] && usage +fi + +if [ $DEFAULT ] ; then + [[ $(wget $WEEKURL -O- 2>/dev/null) ]] || nolink $WEEKURL + intARR=($(wget -q -O - $WEEKURL | awk '/\| Week / { + cmd = "date -d " $2 " +%s" + cmd | getline mydate + close(cmd) + print mydate + (86400 * 6) + }')) + DATE=$( LANG=en_us_8859_1;date -d $(date +%d-%b-%Y) +%s) + for II in ${!intARR[@]} ; do + (( $DATE > ${intARR[$II]} )) || break; + done + WEEK=$II + # echo "DEBUG:TMP:$DEFAULT:W[$WEEK]:$1:$DATE:" +fi + +(( WEEK > 11 )) && WEEK=11 +WEEK=$(printf "W%2.2d\n" $WEEK) + +# echo $WEEK ; exit + +# Is this the correct WEEK? +read -r -p "Is this WEEK $WEEK ? [y/N] " response +case "$response" in + [yY][eE][sS]|[yY]) + ;; + *) + echo "It is not Week $WEEK!" + usage + ;; +esac + +# TXT +[ -d $RESDIR ] || mkdir -p $RESDIR +pushd $RESDIR +for II in W?? ; do + [ -d $II ] || continue + TARFILE=my$II.tar.xz + TARFASC=$TARFILE.asc + rm -vf $TARFILE $TARFASC + echo "tar cfJ $TARFILE $II/" + tar cfJ $TARFILE $II/ + echo "gpg --armor --output $TARFASC --encrypt --recipient $REC1 --recipient $REC2 $TARFILE" + gpg --armor --output $TARFASC --encrypt --recipient $REC1 --recipient $REC2 $TARFILE +done +popd + +if [[ "$WEEK" != "W00" ]] && [[ "$WEEK" != "W01" ]] ; then + II="${RESDIR}my$WEEK.tar.xz.asc" + echo "Check and move $II..." + [ -f $II ] && mv -vf $II . +fi + +echo "rm -f $SHA $SHA.asc" +rm -f $SHA $SHA.asc + +echo "sha256sum $FILES > $SHA" +sha256sum $FILES > $SHA + +echo "# ################ CHECKSUM ###### #########" +echo "sha256sum -c $SHA" +sha256sum -c $SHA + +echo "# ################# SIGNING CHECKSUM ######### ######### ########" +echo "gpg --output $SHA.asc --armor --sign --detach-sign $SHA" +gpg --output $SHA.asc --armor --sign --detach-sign $SHA + +echo "# ################# VERIFY ######### ######### ######### ########" +echo "gpg --verify $SHA.asc $SHA" +gpg --verify $SHA.asc $SHA + +echo "" +echo "==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ====" +echo "==== ==== ==== ATTN: is this WEEK $WEEK ?? === ==== ==== ====" +echo "==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ====" +echo "" + +exit 0 + + diff --git a/TXT/myupdate.txt b/TXT/myupdate.txt index 39dbadf..34c9863 100644 --- a/TXT/myupdate.txt +++ b/TXT/myupdate.txt @@ -1 +1 @@ -OS232W01 +OS232W02