/[smecontribs]/rpms/smeserver-ddclient/contribs9/smeserver-ddclient-1.2.1-bz9450-new-ip-detection.patch
ViewVC logotype

Contents of /rpms/smeserver-ddclient/contribs9/smeserver-ddclient-1.2.1-bz9450-new-ip-detection.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Sun Jan 20 05:42:51 2019 UTC (5 years, 9 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-ddclient-1_2_1-12_el6_sme
Changes since 1.1: +2 -2 lines
* Sat Jan 19 2019 Jean-Philipe Pialasse <tests@pialasse.com> 1.2.1-12.sme
- fix spdns migrate to spdyn.de [SME: 10593]
- add new way to detect new ip [SME: 9450]

1 diff -Nur smeserver-ddclient-1.2.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient smeserver-ddclient-1.2.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient
2 --- smeserver-ddclient-1.2.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient 2019-01-19 21:10:55.543000000 -0500
3 +++ smeserver-ddclient-1.2.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient 2019-01-19 23:46:36.234000000 -0500
4 @@ -305,4 +305,48 @@
5 <base>SUCCESSFULLY_MODIFIED_RETRIEVE_IP</base>
6 <trans>You have successfully modified the retrieve IP options.</trans>
7 </entry>
8 + <entry>
9 + <base>RETRIEVE_METHOD</base>
10 + <trans>Method to retrieve new IP:</trans>
11 + </entry>
12 + <entry>
13 + <base>RETRIEVE_IF</base>
14 + <trans>Local interface to get new IP, if selected interface method</trans>
15 + </entry>
16 + <entry>
17 + <base>RETRIEVE_CMD</base>
18 + <trans>Comand to execute to get IP, if selected comand method</trans>
19 + </entry>
20 + <entry>
21 + <base>SME external Interface</base>
22 + <trans>SME external interface</trans>
23 + </entry>
24 + <entry>
25 + <base>SME configuration DB</base>
26 + <trans>SME configuration DB</trans>
27 + </entry>
28 + <entry>
29 + <base>web</base>
30 + <trans>Web query</trans>
31 + </entry>
32 + <entry>
33 + <base>Interface</base>
34 + <trans>IP from interface</trans>
35 + </entry>
36 + <entry>
37 + <base>IP</base>
38 + <trans>Manual IP setting</trans>
39 + </entry>
40 + <entry>
41 + <base>Command</base>
42 + <trans>Command to execute</trans>
43 + </entry>
44 + <entry>
45 + <base>RETRIEVE_IP</base>
46 + <trans>IP to manually force</trans>
47 + </entry>
48 +
49 +
50 +
51 +
52 </lexicon>
53 diff -Nur smeserver-ddclient-1.2.1.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers smeserver-ddclient-1.2.1/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers
54 --- smeserver-ddclient-1.2.1.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers 2019-01-19 21:10:55.544000000 -0500
55 +++ smeserver-ddclient-1.2.1/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers 2019-01-20 00:19:43.400000000 -0500
56 @@ -9,5 +9,45 @@
57 pid=/var/run/ddclient.pid # record PID in file.
58 ssl=$ssl
59 #);
60 +
61 + my $method = $ddclient{'method'}||'web';
62 + my $webskip = $ddclient{'webskip'}||'IP Address:';
63 + my $cmdskip = $ddclient{'cmdskip'}||'';
64 + my $ifskip = $ddclient{'ifskip'}||'';
65 + my $Extinterface = $ddclient{'Extinterface'}|| $ExternalInterface{'Name'}|| '';
66 + my $cmd = $ddclient{'cmd'} || '/sbin/e-smith/db configuration getprop ExternalInterface IPAddress';
67 + my $ForceIP = $ddclient{'ForceIP'} || $ExternalInterface{'IPAddress'} || $ExternalIP || '';
68 +
69 + if ( $method eq 'smeIF' ) {
70 + # we use SME db to get the external interface NAME : ppp0, eth1, tap0...
71 + $Extinterface = $ExternalInterface{'Name'} ||$Extinterface;
72 + $OUT .="use=if, if=$Extinterface\n";
73 + } elsif ( $method eq 'smeCMD') {
74 + # we choose to just get the value from configuration DB
75 + $OUT .="use=cmd, cmd='/sbin/e-smith/db configuration getprop ExternalInterface IPAddress'\n";
76 + } elsif ( $method eq 'web') {
77 + # old good way, we get the value from an external web page. best if we are not gateway
78 + $OUT .="use=web, web=$ddclient{'urlcheckip'}\/, web-skip='$webskip' \n";
79 + } elsif ( $method eq 'if') {
80 + # we have a specific configuation and can not trust sme to get the interface correctly
81 + $OUT .="use=if, if=$Extinterface, if-skip='$ifskip'\n";
82 + } elsif ( $method eq 'ip') {
83 + # we want to force manually
84 + $OUT.="use=ip, ip=$ForceIP \n";
85 + } elsif ( $method eq 'cmd') {
86 + $OUT .="use=cmd, cmd='$cmd', cmd-skip='$cmdskip' \n";
87 + } else {
88 + # fw method
89 + my $fwaddress = $ddclient{'fwaddress'}||'';
90 + my $fwlogin = $ddclient{'fwlogin'}||'';
91 + my $fwpassword = $ddclient{'fwpassword'}||'';
92 + my $fwskip = $ddclient{'fwskip'}||'';
93 + $OUT .= "use=$method, fw=$fwaddress";
94 + $OUT .= ", fw-login=$fwlogin " if ( $fwlogin ne '' );
95 + $OUT .= ", fw-password=$fwpassword " if ( $fwpassword ne '' );
96 + $OUT .= ", fw-skip='$fwskip' " if ( $fwskip ne '' );
97 + $OUT .= "\n";
98 + }
99 +
100 }
101
102 diff -Nur smeserver-ddclient-1.2.1.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration smeserver-ddclient-1.2.1/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration
103 --- smeserver-ddclient-1.2.1.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration 2019-01-19 21:15:16.756000000 -0500
104 +++ smeserver-ddclient-1.2.1/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration 2019-01-19 23:52:13.859000000 -0500
105 @@ -5,8 +5,6 @@
106
107 my $ddb = esmith::DomainsDB->open_ro();
108
109 - $OUT .="use=web, web=$ddclient{'urlcheckip'}\/, web-skip='IP Address:' \n";
110 -
111 for my $edom ( $ddb->domains )
112 {
113 {
114 diff -Nur smeserver-ddclient-1.2.1.old/root/etc/e-smith/web/functions/ddclient smeserver-ddclient-1.2.1/root/etc/e-smith/web/functions/ddclient
115 --- smeserver-ddclient-1.2.1.old/root/etc/e-smith/web/functions/ddclient 2019-01-19 21:10:55.546000000 -0500
116 +++ smeserver-ddclient-1.2.1/root/etc/e-smith/web/functions/ddclient 2019-01-19 23:48:15.869000000 -0500
117 @@ -58,6 +58,7 @@
118 sub genServer ($$);
119
120 sub genRetrieve($$);
121 +sub genRetrieveMethod($$);
122 sub performRetrieve($);
123
124 ################################################################################################################"
125 @@ -226,7 +227,32 @@
126 -labels => \%Labels));
127 }
128 #------------------------------------------------------------
129 +sub genRetrieveMethod($$) {
130 + my ($q, $curSetting) = @_;
131 +
132 + if ((! defined $curSetting) || ($curSetting eq ''))
133 + {
134 + $curSetting = 'web';
135 + }
136
137 + my %Labels = (
138 + 'smeIF' => $fm->localise('SME external interface'),
139 + 'smeCMD' => $fm->localise('SME configuration DB'),
140 + 'web' => $fm->localise('web'),
141 + 'if' => $fm->localise('Interface'),
142 + 'ip' => $fm->localise('IP'),
143 + 'cmd' => $fm->localise('Command'),
144 + );
145 +
146 + return esmith::cgi::genCell ($q, $q->popup_menu (-name => 'retrievemethod',
147 + -values => [
148 + 'smeIF','smeCMD','web','if','ip','cmd'
149 + ],
150 + -default => $curSetting,
151 + -labels => \%Labels));
152 +}
153 +#------------------------------------------------------------
154 +#
155 sub showInitial ($$)
156 {
157 my ($q, $msg) = @_;
158 @@ -253,25 +279,37 @@
159 # get the ip retrieve method
160 #------------------------------------------------------------
161 my $ddretrieve=$conf->get('ddclient');
162 + my $ExtIF=$conf->get('ExternalInterface');
163 my $DeamonUpdate=$ddretrieve->prop('DeamonUpdate')|| '300';
164 my $urlcheckip=$ddretrieve->prop('urlcheckip')|| 'checkip.dyndns.org';
165 my $ssl=$ddretrieve->prop('SSL')|| 'yes';
166 + my $method=$ddretrieve->prop('method')||'web';
167 + my $Extinterface=$ddretrieve->prop('Extinterface')||'';
168 + my $cmd=$ddretrieve->prop('cmd')||'';
169 + my $forceIP=$ddretrieve->prop('ForceIP')||'';
170
171 print $q->startform (-method => 'POST',
172 -action => $q->url (-absolute => 1));
173
174 print $q->table ({border => 0, cellspacing => 0, cellpadding => 4},
175 - $q->Tr (esmith::cgi::genCell ($q,$fm->localise('RETRIEVE_SSL')),
176 + $q->Tr (esmith::cgi::genCell($q,
177 + $fm->localise('RETRIEVE_SSL').":", 'sme-noborders-label' ),
178 genRetrieve($q,$ssl)),
179 # esmith::cgi::genWidgetRow ($q, $fm->localise('RETRIEVE_SSL')),
180 # $q->popup_menu (-name => 'SSL',
181 # -values => ['yes', 'no'],
182 # -default => $ssl),
183 # -labels => \%status)) ,
184 -
185 -
186 $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_DEAMONUPDATE'),
187 "retrievedeamonupdate",$DeamonUpdate)),
188 + $q->Tr (esmith::cgi::genCell ($q,$fm->localise('RETRIEVE_METHOD').":", 'sme-noborders-label' ),
189 + genRetrieveMethod($q,$method)),
190 + $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_IF'),
191 + "retrieveinterface",$Extinterface)),
192 + $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_CMD'),
193 + "retrievecmd",$cmd)),
194 + $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_IP'),
195 + "retrieveip",$forceIP)),
196 $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_URLCHECKIP'),
197 "retrieveurlcheckip",$urlcheckip)),
198 esmith::cgi::genButtonRow ( $q,
199 @@ -480,11 +518,19 @@
200 my $deamonupdate =$q->param('retrievedeamonupdate');
201 my $urlcheckip =$q->param('retrieveurlcheckip');
202 my $ssl = $q->param('retrievessl');
203 + my $retrievemethod = $q->param('retrievemethod');
204 + my $retrieveinterface = $q->param('retrieveinterface');
205 + my $retrievecmd = $q->param('retrievecmd');
206 + my $retrieveip = $q->param('retrieveip');
207
208 my $ddclient=$conf->get('ddclient');
209 $ddclient->set_prop('urlcheckip' => $urlcheckip);
210 $ddclient->set_prop('DeamonUpdate' => $deamonupdate);
211 $ddclient->set_prop('SSL' => $ssl);
212 + $ddclient->set_prop('method' => $retrievemethod);
213 + $ddclient->set_prop('Extinterface' => $retrieveinterface );
214 + $ddclient->set_prop('cmd' => $retrievecmd);
215 + $ddclient->set_prop('ForceIP' => $retrieveip);
216
217 $domaindb->reload();
218

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed