scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit e0813bd00796ff153a0458334c85f41f2a8fa9ad
parent db1e123939153dfdb8a41926806d3c0e41fdc9f5
Author: sin <sin@2f30.org>
Date:   Wed Dec 25 12:04:16 +0000

Move sids to sids/

Diffstat:
sids | 43-------------------------------------------
sids/sids | 43+++++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/sids b/sids @@ -1,43 +0,0 @@ -#!/bin/sh - -# path of the signature store -sigstore=$(test -n "$SIGSTORE" && echo "$SIGSTORE" || echo /sigstore) -# paths to be hashed -sigpath=$(test -n "$SIGPATH" && echo "$SIGPATH" || \ - echo /bin:/sbin:/usr) - -set -o noclobber - -usage() { - echo "usage: $(basename $0) [-gv]" 1>&2 - exit 1 -} - -if test $1; then - option=$1 -else - usage -fi - -mkdir -p "$sigstore" - -case $option in --g) - echo "$sigpath" | awk -F: '{for (i=1; i<=NF; i++) {print $i}}' | - while read path; do - mtree_path=mtree$(echo "$path" | sed 's/\//_/g') - mtree -c -K sha256digest -p "$path" > "$sigstore/$mtree_path" - done - chmod 600 $sigstore/* - ;; --v) - echo "$sigpath" | awk -F: '{for (i=1; i<=NF; i++) {print $i}}' | - while read path; do - mtree_path=mtree$(echo "$path" | sed 's/\//_/g') - mtree -p "$path" < "$sigstore/$mtree_path" - done - ;; -*) - usage - ;; -esac diff --git a/sids/sids b/sids/sids @@ -0,0 +1,43 @@ +#!/bin/sh + +# path of the signature store +sigstore=$(test -n "$SIGSTORE" && echo "$SIGSTORE" || echo /sigstore) +# paths to be hashed +sigpath=$(test -n "$SIGPATH" && echo "$SIGPATH" || \ + echo /bin:/sbin:/usr) + +set -o noclobber + +usage() { + echo "usage: $(basename $0) [-gv]" 1>&2 + exit 1 +} + +if test $1; then + option=$1 +else + usage +fi + +mkdir -p "$sigstore" + +case $option in +-g) + echo "$sigpath" | awk -F: '{for (i=1; i<=NF; i++) {print $i}}' | + while read path; do + mtree_path=mtree$(echo "$path" | sed 's/\//_/g') + mtree -c -K sha256digest -p "$path" > "$sigstore/$mtree_path" + done + chmod 600 $sigstore/* + ;; +-v) + echo "$sigpath" | awk -F: '{for (i=1; i<=NF; i++) {print $i}}' | + while read path; do + mtree_path=mtree$(echo "$path" | sed 's/\//_/g') + mtree -p "$path" < "$sigstore/$mtree_path" + done + ;; +*) + usage + ;; +esac