Skip to content
Snippets Groups Projects
Select Git revision
  • 30811f7f1bd214dce161f7f3319801f71d575115
  • v2018.2.x default
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
42 results

autoupdater.rst

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    sign.sh 1022 B
    #!/bin/sh
    
    set -e
    
    if [ $# -ne 2 ] || [ "-h" = "$1" ] || [ "--help" = "$1" ] || [ ! -r "$1" ] || [ ! -r "$2" ]; then
    	cat <<EOHELP
    Usage: $0 <secret> <manifest>
    
    sign.sh adds lines to a manifest to indicate the approval
    of the integrity of the firmware as required for automated
    updates. The first argument <secret> references a file harboring
    the private key of a public-private key pair of a developer
    that referenced by its public key in the site configuration.
    The script may be performed multiple times to the same document
    to indicate an approval by multiple developers.
    
    See also
     * ecdsautils on https://github.com/freifunk-gluon/ecdsautils
    
    EOHELP
    	exit 1
    fi
    
    SECRET="$1"
    
    manifest="$2"
    upper="$(mktemp)"
    lower="$(mktemp)"
    
    trap 'rm -f "$upper" "$lower"' EXIT
    
    awk 'BEGIN    {
    	sep = 0
    }
    
    /^---$/ {
    	sep = 1;
    	next
    }
    
    {
    	if(sep == 0) {
    		print > "'"$upper"'"
    	} else {
    		print > "'"$lower"'"
    	}
    }' "$manifest"
    
    ecdsasign "$upper" < "$SECRET" >> "$lower"
    
    (
    	cat  "$upper"
    	echo ---
    	cat  "$lower"
    ) > "$manifest"