-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce easytls-export-tctip-lib.sh
This script exports the relevant parts of `easytls-tctip.lib` to: * `easytls` - All functions, except "Loaded" function * `easytls-client-connect.sh` - First three, except "Loaded" function. Signed-off-by: Richard T Bonhomme <[email protected]>
- Loading branch information
1 parent
ac05a2b
commit 28936a4
Showing
1 changed file
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
#!/bin/sh | ||
|
||
f_et_top () | ||
{ | ||
print_line=1 | ||
{ | ||
while read -r line | ||
do | ||
[ $print_line ] && printf '%s\n' "${line}" | ||
[ "${line}" = "${begin}" ] && break | ||
done < "${src_et}" | ||
} > "${dst_et1}" || return 9 | ||
} | ||
|
||
f_et_mid () | ||
{ | ||
unset print_line | ||
{ | ||
while read -r line | ||
do | ||
[ "${line}" = "${begin}" ] && print_line=1 && continue | ||
[ "${line}" = "${end_et}" ] && unset print_line | ||
[ $print_line ] && printf '%s\n' "${line}" | ||
: | ||
done < "${src_tl}" | ||
} > "${dst_et2}" || return 9 | ||
} | ||
|
||
f_et_end () | ||
{ | ||
unset print_line | ||
{ | ||
while read -r line | ||
do | ||
[ "${line}" = "${end_et}" ] && print_line=1 | ||
[ $print_line ] && printf '%s\n' "${line}" | ||
: | ||
done < "${src_et}" | ||
} > "${dst_et3}" || return 9 | ||
} | ||
|
||
f_et_mv () | ||
{ | ||
cat "${dst_et1}" "${dst_et2}" "${dst_et3}" >> "${src_et}.new" | ||
mv -f "${src_et}.new" "${src_et}" | ||
rm -f "${dst_et1}" "${dst_et2}" "${dst_et3}" | ||
} | ||
|
||
f_cc_top () | ||
{ | ||
print_line=1 | ||
{ | ||
while read -r line | ||
do | ||
[ $print_line ] && printf '%s\n' "${line}" | ||
[ "${line}" = "${begin}" ] && break | ||
done < "${src_cc}" | ||
} > "${dst_cc1}" || return 9 | ||
} | ||
|
||
f_cc_mid () | ||
{ | ||
unset print_line | ||
{ | ||
while read -r line | ||
do | ||
[ "${line}" = "${begin}" ] && print_line=1 && continue | ||
[ "${line}" = "${end_cc}" ] && unset print_line | ||
[ $print_line ] && printf '%s\n' "${line}" | ||
: | ||
done < "${src_tl}" | ||
} > "${dst_cc2}" || return 9 | ||
} | ||
|
||
f_cc_end () | ||
{ | ||
unset print_line | ||
{ | ||
while read -r line | ||
do | ||
[ "${line}" = "${end_cc}" ] && print_line=1 | ||
[ $print_line ] && printf '%s\n' "${line}" | ||
: | ||
done < "${src_cc}" | ||
} > "${dst_cc3}" || return 9 | ||
} | ||
|
||
f_cc_mv () | ||
{ | ||
cat "${dst_cc1}" "${dst_cc2}" "${dst_cc3}" >> "${src_cc}.new" | ||
mv -f "${src_cc}.new" "${src_cc}" | ||
rm -f "${dst_cc1}" "${dst_cc2}" "${dst_cc3}" | ||
} | ||
|
||
|
||
################# | ||
|
||
|
||
begin="#=# 9273398a-5284-4c1f-aec5-d597ceb1d085" | ||
|
||
end_et="#=# 7f97f537-eafd-40c3-8f31-2fee10c12ad3" | ||
end_cc="#=# b66633f8-3746-436a-901f-29638199b187" | ||
|
||
src_tl="./easytls-tctip.lib" | ||
|
||
src_et="./easytls" | ||
dst_et1="${src_et}.tmp1" | ||
dst_et2="${src_et}.tmp2" | ||
dst_et3="${src_et}.tmp3" | ||
rm -f "${dst_et1}" "${dst_et2}" "${dst_et3}" "${src_et}.new" | ||
cp --attributes-only "${src_et}" "${src_et}.new" | ||
|
||
src_cc="./easytls-client-connect.sh" | ||
dst_cc1="${src_cc}.tmp1" | ||
dst_cc2="${src_cc}.tmp2" | ||
dst_cc3="${src_cc}.tmp3" | ||
rm -f "${dst_cc1}" "${dst_cc2}" "${dst_cc3}" "${src_cc}.new" | ||
cp --attributes-only "${src_cc}" "${src_cc}.new" | ||
|
||
OFS="${IFS}" | ||
IFS='' | ||
|
||
echo "* easytls" | ||
f_et_top || return 11 | ||
f_et_mid || return 12 | ||
f_et_end || return 13 | ||
f_et_mv || return 14 | ||
|
||
echo "* easytls-client-connect.sh" | ||
f_cc_top || return 21 | ||
f_cc_mid || return 22 | ||
f_cc_end || return 23 | ||
f_cc_mv || return 24 | ||
|
||
IFS="${OFS}" |
28936a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#240