X-Git-Url: https://iankelling.org/git/?p=iankelling.org;a=blobdiff_plain;f=set-comments;h=b87f21166932f9f7ec24b9b2c21f267f488adf3a;hp=5694629e8afcd8bd0b9b53d99ddf62d29792ca93;hb=7c4081c2716a935c0e5a618dfed4cf16500bdec1;hpb=d0a5b73d2a275bfff5957961f2360df8966bee22 diff --git a/set-comments b/set-comments index 5694629..b87f211 100755 --- a/set-comments +++ b/set-comments @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # Copyright (C) 2016 Ian Kelling # This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR cd "${BASH_SOURCE%/*}/proposed-comments" -shell="ssh iankelling.org" +shell="ssh -oStrictHostKeyChecking=no $(chost iankelling.org)" while [[ $1 ]]; do case $1 in -a) all=true; shift ;; @@ -32,6 +32,10 @@ s="$shell sqlite3 $PWD/comments.sqlite" grep -Eo '^[^|]+\|[^|]+' /tmp/hcomments | while IFS='|' read -r id state; do #echo "$id -- $state" # debug print - sqlite3 comments.sqlite "update c set state='$state' where id = '$id'" + if [[ $state == delete ]]; then + $s <<<"delete from c where id = '$id';" + else + $s <<<"update c set state='$state' where id = '$id';" + fi done $shell $PWD/../build.rb