Skip to content

Commit

Permalink
fix #9 - jq sync issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danimesq committed Feb 8, 2022
1 parent 7fac11c commit e20cbe2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
28 changes: 10 additions & 18 deletions .gitmeta
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
chown -h 1000:1000 './.gitmeta'
chmod 0755 './.gitmeta'
/usr/bin/touch -hcmd "2022-02-08 11:47:00.0800000000 -0300" './.gitmeta'
/usr/bin/touch -hcad "2022-02-08 11:07:12.0000000000 -0300" './.gitmeta'
/usr/bin/touch -hcmd "2022-02-08 12:11:44.2200000000 -0300" './.gitmeta'
/usr/bin/touch -hcad "2022-02-08 11:47:00.0000000000 -0300" './.gitmeta'
chown -h 1000:1000 './recipe.json'
chmod 0755 './recipe.json'
/usr/bin/touch -hcmd "2021-11-10 16:35:54.1000000000 -0300" './recipe.json'
/usr/bin/touch -hcad "2022-02-07 20:11:50.0000000000 -0300" './recipe.json'
chown -h 1000:1000 './update-worker.sh'
chmod 0755 './update-worker.sh'
/usr/bin/touch -hcmd "2021-12-08 22:43:54.4800000000 -0300" './update-worker.sh'
/usr/bin/touch -hcad "2022-02-07 20:11:50.0000000000 -0300" './update-worker.sh'
chown -h 1000:1000 './updates-patch_important.sh'
chmod 0755 './updates-patch_important.sh'
/usr/bin/touch -hcmd "2022-02-08 11:41:46.1900000000 -0300" './updates-patch_important.sh'
/usr/bin/touch -hcad "2022-02-08 11:41:46.0000000000 -0300" './updates-patch_important.sh'
chown -h 1000:1000 './updates-patch_optional.sh'
chmod 0755 './updates-patch_optional.sh'
/usr/bin/touch -hcmd "2022-02-08 11:41:23.8900000000 -0300" './updates-patch_optional.sh'
/usr/bin/touch -hcad "2022-02-08 11:41:22.0000000000 -0300" './updates-patch_optional.sh'
chown -h 1000:1000 './web3updater'
chmod 0755 './web3updater'
/usr/bin/touch -hcmd "2022-02-08 11:44:44.8800000000 -0300" './web3updater'
/usr/bin/touch -hcad "2022-02-08 11:46:32.0000000000 -0300" './web3updater'
chown -h 1000:1000 './sample_updates_3-5.sh'
chmod 0755 './sample_updates_3-5.sh'
/usr/bin/touch -hcmd "2022-02-08 12:09:30.9100000000 -0300" './sample_updates_3-5.sh'
/usr/bin/touch -hcad "2022-02-08 12:11:16.0000000000 -0300" './sample_updates_3-5.sh'
chown -h 1000:1000 './updates.sh'
chmod 0755 './updates.sh'
/usr/bin/touch -hcmd "2022-02-08 12:10:05.4500000000 -0300" './updates.sh'
/usr/bin/touch -hcad "2022-02-08 12:11:16.0000000000 -0300" './updates.sh'
4 changes: 2 additions & 2 deletions sample_updates_3-5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ "$1" = "apply3" ]; then
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) -ge 3 ]; then
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) -ge "5" ]; then
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) -ge 5 ]; then
# congratulations to ENS for removing Brantly and Twitter for continuing it. Despite everything Brantly Millegan did to ENS, meritocracy didn't won for a men who spreads hate veiled into religion.
contents1="$(jq -r '.ens' /usr/lib/web3updater/update.json)"
cidat=$(ethereal ens contenthash get --domain=${contents1})
Expand All @@ -25,7 +25,7 @@ fi

if [ "$1" = "apply4" ]; then
# --------------##########---------------------- This checks for update 4 and does its specific actions
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) -ge "4" ]; then
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) -ge 4 ]; then
recentlycheckedat=$(date +"%s")
contents="$(jq ".recently_checked_at = \"$recentlycheckedat\"" /usr/lib/web3updater/update.json)" && \
echo "${contents}" > /usr/lib/web3updater/update.json
Expand Down
35 changes: 22 additions & 13 deletions updates.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
#!/bin/bash

if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = "0" ]; then
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = 0 ]; then
echo "Installing update 1..."
echo "This is a thing that the first update did." > /usr/lib/web3updater/patch_1.txt
contents="$(jq '.patch_at = "1"' /usr/lib/web3updater/update.json)" && \
echo "${contents}" > /usr/lib/web3updater/update.json
# 29-08 - NEW DISCOVERY: replace this 2 line with this: cat config.json | jq '. + {patch_at: "1"}' > config.json2; mv -f config.json{2,}
#contents="$(jq '.patch_at = "1"' /usr/lib/web3updater/update.json)" && \
#echo "${contents}" > /usr/lib/web3updater/update.json
#cat /usr/lib/web3updater/update.json | jq '. + {patch_at: "1"}' > /usr/lib/web3updater/update.json2; mv -f /usr/lib/web3updater/update.json{2,}
tmp="$(mktemp)"; cat /usr/lib/web3updater/update.json | jq '. + {patch_at: 1}' >"$tmp" && mv "$tmp" /usr/lib/web3updater/update.json
fi

if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = "1" ]; then
if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = 1 ]; then
echo "Installing update 2..."
echo "This is another effect made by an update." > /usr/lib/web3updater/another_effect.txt
contents="$(jq '.patch_at = "2"' /usr/lib/web3updater/update.json)" && \
echo "${contents}" > /usr/lib/web3updater/update.json
#contents="$(jq '.patch_at = "2"' /usr/lib/web3updater/update.json)" && \
#echo "${contents}" > /usr/lib/web3updater/update.json
#cat /usr/lib/web3updater/update.json | jq '. + {patch_at: "2"}' > /usr/lib/web3updater/update.json2; mv -f /usr/lib/web3updater/update.json{2,}
tmp="$(mktemp)"; cat /usr/lib/web3updater/update.json | jq '. + {patch_at: 2}' >"$tmp" && mv "$tmp" /usr/lib/web3updater/update.json
fi

if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = 2 ]; then
echo "Installing update 3..."
rm /usr/lib/web3updater/patch_1.txt
rm /usr/lib/web3updater/another_effect.txt
cat /usr/lib/web3updater/update.json | jq '. + {"cid_at": ""}' | tee /usr/lib/web3updater/update.json
contents="$(jq '.patch_at = "3"' /usr/lib/web3updater/update.json)" && \
echo "${contents}" > /usr/lib/web3updater/update.json
#contents="$(jq '.patch_at = "3"' /usr/lib/web3updater/update.json)" && \
#echo "${contents}" > /usr/lib/web3updater/update.json
#cat /usr/lib/web3updater/update.json | jq '. + {patch_at: "3"}' > /usr/lib/web3updater/update.json2; mv -f /usr/lib/web3updater/update.json{2,}
tmp="$(mktemp)"; cat /usr/lib/web3updater/update.json | jq '. + {patch_at: 3}' >"$tmp" && mv "$tmp" /usr/lib/web3updater/update.json
fi

if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = 3 ]; then
echo "Installing update 4..."
cat /usr/lib/web3updater/update.json | jq '. + {"recently_checked_at": ""}' | tee /usr/lib/web3updater/update.json
cat /usr/lib/web3updater/update.json | jq '. + {"recently_updated_at": ""}' | tee /usr/lib/web3updater/update.json
contents="$(jq '.patch_at = "4"' /usr/lib/web3updater/update.json)" && \
echo "${contents}" > /usr/lib/web3updater/update.json
#contents="$(jq '.patch_at = "4"' /usr/lib/web3updater/update.json)" && \
#echo "${contents}" > /usr/lib/web3updater/update.json
#cat /usr/lib/web3updater/update.json | jq '. + {patch_at: "4"}' > /usr/lib/web3updater/update.json2; mv -f /usr/lib/web3updater/update.json{2,}
tmp="$(mktemp)"; cat /usr/lib/web3updater/update.json | jq '. + {patch_at: 4}' >"$tmp" && mv "$tmp" /usr/lib/web3updater/update.json
fi

if [ $(jq -r '.patch_at' /usr/lib/web3updater/update.json) = 4 ]; then
echo "Installing update 5..."
cat /usr/lib/web3updater/update.json | jq '. + {"ens": "update.updating.eth"}' | tee /usr/lib/web3updater/update.json
contents="$(jq '.patch_at = "5"' /usr/lib/web3updater/update.json)" && \
echo "${contents}" > /usr/lib/web3updater/update.json
#contents="$(jq '.patch_at = "5"' /usr/lib/web3updater/update.json)" && \
#echo "${contents}" > /usr/lib/web3updater/update.json
#cat /usr/lib/web3updater/update.json | jq '. + {patch_at: "5"}' > /usr/lib/web3updater/update.json2; mv -f /usr/lib/web3updater/update.json{2,}
tmp="$(mktemp)"; cat /usr/lib/web3updater/update.json | jq '. + {patch_at: 5}' >"$tmp" && mv "$tmp" /usr/lib/web3updater/update.json
fi

0 comments on commit e20cbe2

Please sign in to comment.