Permalink
Browse files

change inclusion of library files to a more general solution

  • Loading branch information...
PeterPawn committed Nov 18, 2016
1 parent 8bda954 commit 6b284cf6c4bafa1309f879d2243a45e32925526a
View
@@ -0,0 +1,6 @@
#! /bin/sh
. ${YF_SCRIPT_DIR:-.}/yf_helpers
while read length enc_length encoded; do
hex=$(echo -n "$encoded" | base32.py decode | yf_bin2hex)
echo -e "$length\t$(( ${#hex} / 2 ))\t$hex"
done
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -117,8 +117,7 @@ discovery_interval=1
#
# include YourFritz shell library functions
#
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
#
# debug output
#
View
@@ -0,0 +1,8 @@
#! /bin/sh
[ "$1" = do ] && n="" || n="n"
printf "Sync to FB7490 ...\n"
rsync -a${n}P functions/ /ssh/fb7490/var/media/ftp/root/bin/functions/
printf "Sync to modfs repository ...\n"
rsync -a${n}P functions/ ../../modfs/bin/scripts/functions/
printf "creating archive to deploy ...\n"
tar -c -v -f shell_lib.tar yf_helpers functions
View
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICnzCCAgigAwIBAgIGDMvBfzHgMA0GCSqGSIb3DQEBBQUAMCgxEjAQBgNVBAMM
CW1pdG1wcm94eTESMBAGA1UECgwJbWl0bXByb3h5MB4XDTE0MDgwMTIwNTM0M1oX
DTE2MDcyMTIwNTM0M1owKDESMBAGA1UEAwwJbWl0bXByb3h5MRIwEAYDVQQKDAlt
aXRtcHJveHkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAN/jZY0V1IHXX9fD
Z+GfLlb0Q2m7jGZh5OBMKTvrqh32t1mhhMOMMjcPkEbBswDRNvB0vBoSfKLo6Jbq
8FVgO/2PutEgoL3EA3u43HZHRZSKX5Q7Kd6jpnxAstK/psLnUrOA3Kli/seIi8Io
r+t+lC/sJKgD8bgI5ZZBA1PNgPRxAgMBAAGjgdMwgdAwDwYDVR0TAQH/BAUwAwEB
/zAUBglghkgBhvhCAQEBAf8EBAMCAgQwewYDVR0lAQH/BHEwbwYIKwYBBQUHAwEG
CCsGAQUFBwMCBggrBgEFBQcDBAYIKwYBBQUHAwgGCisGAQQBgjcCARUGCisGAQQB
gjcCARYGCisGAQQBgjcKAwEGCisGAQQBgjcKAwMGCisGAQQBgjcKAwQGCWCGSAGG
+EIEATALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFIqmFUYQeKMyL5SYu6fJO64b4PEQ
MA0GCSqGSIb3DQEBBQUAA4GBANyD2tqAESKk9SUNIZg+ngIzeWoJRNMMPMv8DGuC
Eq12VR6qu8uFPihsaDT7Zo789K5CcKjnCBMXQz9pPyyLtUG7juBVY0RTi+kvZ5tM
SryHn2axHRxFnGwzpZ3zAVmufMMC7dho7C9/TrMlq06+uyvloCBTdTV726gOiOIs
b5Ry
-----END CERTIFICATE-----
View
@@ -20,8 +20,7 @@
# helper functions
#
##################################################################################
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# create the image now
@@ -0,0 +1,68 @@
#! /bin/sh
##################################################################################
#
# prepare a full TFFS image containing the name table, the environment settings
# and the counters
#
# Parameters:
#
# $1 - path to name table file
# $2 - path to environment file
# $3 - path to counters file
# $n - additional file(s) to be included; the TFFS node ID is determined by the
# name of the file (that means, it has to be the 4-character hexadecimal ID
# to be used, e.g. 001d for "provider_addtive.tar") and the content has to be
# the (zlib) deflated text (or binary data); the name may carry any suffix
# as "extension" - "001d.bin" is a valid one.
#
##################################################################################
#
# helper functions
#
##################################################################################
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# create the image now
#
##################################################################################
#
# segment header with the earliest value, will be incremented with each new
# version written to TFFS
#
yf_pack B16 1 B16 4 8 255 8 255 8 255 8 254
#
# add name table
#
cat $4
#
# add environment
#
environment_to_tffs "$1" <"$2"
#
# add counters
#
counter_to_tffs <"$3"
#
# add optional files
#
shift 4
for name in $*; do
id="${name##*/}"
id="${id%%.*}"
content="$(cat "$name" | yf_bin2hex)"
len=$(( ${#content} / 2 ))
out="$id$(yf_dec2hex $len 2)$content"
fill=$(( ( ( len + 3 ) & ~3 ) - len ))
while [ $fill -gt 0 ]; do
out="${out}00"
fill=$(( fill - 1 ))
done
yf_hex2bin "$out"
done
##################################################################################
#
# regular end of script reached
#
##################################################################################
exit 0
View
@@ -36,8 +36,7 @@ cntfile=$tmpdir/counter
# helper functions
#
##################################################################################
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# cleanup at exit
View
@@ -42,8 +42,7 @@ tffsdump=$tmpdir/tffsdump
# helper functions
#
##################################################################################
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# create temporary directory and store stdin (it contains our TFFS dump file)
View
@@ -39,8 +39,7 @@ envfile=$tmpdir/environment
# helper functions
#
##################################################################################
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# check, if our name table is present
View
Binary file not shown.
Binary file not shown.
View
@@ -25,8 +25,7 @@
# helper functions
#
##################################################################################
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# fixed identifiers
View
@@ -10,8 +10,7 @@
# include shell library #
# #
#######################################################################################
YF_SCRIPT_DIR="."
. yf_helpers
. ${YF_SCRIPT_DIR:-.}/yf_helpers
#######################################################################################
# #
# constants #

0 comments on commit 6b284cf

Please sign in to comment.