-#!/bin/bash
+#!/bin/bash -l
# Copyright (C) 2016 Ian Kelling
# This program is free software: you can redistribute it and/or modify
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 ;;
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