Skip to content

Commit 28936a4

Browse files
committed
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]>
1 parent ac05a2b commit 28936a4

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed

easytls-export-tcpip-lib.sh

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#!/bin/sh
2+
3+
f_et_top ()
4+
{
5+
print_line=1
6+
{
7+
while read -r line
8+
do
9+
[ $print_line ] && printf '%s\n' "${line}"
10+
[ "${line}" = "${begin}" ] && break
11+
done < "${src_et}"
12+
} > "${dst_et1}" || return 9
13+
}
14+
15+
f_et_mid ()
16+
{
17+
unset print_line
18+
{
19+
while read -r line
20+
do
21+
[ "${line}" = "${begin}" ] && print_line=1 && continue
22+
[ "${line}" = "${end_et}" ] && unset print_line
23+
[ $print_line ] && printf '%s\n' "${line}"
24+
:
25+
done < "${src_tl}"
26+
} > "${dst_et2}" || return 9
27+
}
28+
29+
f_et_end ()
30+
{
31+
unset print_line
32+
{
33+
while read -r line
34+
do
35+
[ "${line}" = "${end_et}" ] && print_line=1
36+
[ $print_line ] && printf '%s\n' "${line}"
37+
:
38+
done < "${src_et}"
39+
} > "${dst_et3}" || return 9
40+
}
41+
42+
f_et_mv ()
43+
{
44+
cat "${dst_et1}" "${dst_et2}" "${dst_et3}" >> "${src_et}.new"
45+
mv -f "${src_et}.new" "${src_et}"
46+
rm -f "${dst_et1}" "${dst_et2}" "${dst_et3}"
47+
}
48+
49+
f_cc_top ()
50+
{
51+
print_line=1
52+
{
53+
while read -r line
54+
do
55+
[ $print_line ] && printf '%s\n' "${line}"
56+
[ "${line}" = "${begin}" ] && break
57+
done < "${src_cc}"
58+
} > "${dst_cc1}" || return 9
59+
}
60+
61+
f_cc_mid ()
62+
{
63+
unset print_line
64+
{
65+
while read -r line
66+
do
67+
[ "${line}" = "${begin}" ] && print_line=1 && continue
68+
[ "${line}" = "${end_cc}" ] && unset print_line
69+
[ $print_line ] && printf '%s\n' "${line}"
70+
:
71+
done < "${src_tl}"
72+
} > "${dst_cc2}" || return 9
73+
}
74+
75+
f_cc_end ()
76+
{
77+
unset print_line
78+
{
79+
while read -r line
80+
do
81+
[ "${line}" = "${end_cc}" ] && print_line=1
82+
[ $print_line ] && printf '%s\n' "${line}"
83+
:
84+
done < "${src_cc}"
85+
} > "${dst_cc3}" || return 9
86+
}
87+
88+
f_cc_mv ()
89+
{
90+
cat "${dst_cc1}" "${dst_cc2}" "${dst_cc3}" >> "${src_cc}.new"
91+
mv -f "${src_cc}.new" "${src_cc}"
92+
rm -f "${dst_cc1}" "${dst_cc2}" "${dst_cc3}"
93+
}
94+
95+
96+
#################
97+
98+
99+
begin="#=# 9273398a-5284-4c1f-aec5-d597ceb1d085"
100+
101+
end_et="#=# 7f97f537-eafd-40c3-8f31-2fee10c12ad3"
102+
end_cc="#=# b66633f8-3746-436a-901f-29638199b187"
103+
104+
src_tl="./easytls-tctip.lib"
105+
106+
src_et="./easytls"
107+
dst_et1="${src_et}.tmp1"
108+
dst_et2="${src_et}.tmp2"
109+
dst_et3="${src_et}.tmp3"
110+
rm -f "${dst_et1}" "${dst_et2}" "${dst_et3}" "${src_et}.new"
111+
cp --attributes-only "${src_et}" "${src_et}.new"
112+
113+
src_cc="./easytls-client-connect.sh"
114+
dst_cc1="${src_cc}.tmp1"
115+
dst_cc2="${src_cc}.tmp2"
116+
dst_cc3="${src_cc}.tmp3"
117+
rm -f "${dst_cc1}" "${dst_cc2}" "${dst_cc3}" "${src_cc}.new"
118+
cp --attributes-only "${src_cc}" "${src_cc}.new"
119+
120+
OFS="${IFS}"
121+
IFS=''
122+
123+
echo "* easytls"
124+
f_et_top || return 11
125+
f_et_mid || return 12
126+
f_et_end || return 13
127+
f_et_mv || return 14
128+
129+
echo "* easytls-client-connect.sh"
130+
f_cc_top || return 21
131+
f_cc_mid || return 22
132+
f_cc_end || return 23
133+
f_cc_mv || return 24
134+
135+
IFS="${OFS}"

0 commit comments

Comments
 (0)