<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>https://wiki.espai.de/index.php?action=history&amp;feed=atom&amp;title=Bash_Scripts</id>
	<title>Bash Scripts - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.espai.de/index.php?action=history&amp;feed=atom&amp;title=Bash_Scripts"/>
	<link rel="alternate" type="text/html" href="https://wiki.espai.de/index.php?title=Bash_Scripts&amp;action=history"/>
	<updated>2026-05-27T17:39:33Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.espai.de/index.php?title=Bash_Scripts&amp;diff=1290&amp;oldid=prev</id>
		<title>Marti: /* Update external DNS */</title>
		<link rel="alternate" type="text/html" href="https://wiki.espai.de/index.php?title=Bash_Scripts&amp;diff=1290&amp;oldid=prev"/>
		<updated>2014-09-05T10:22:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Update external DNS&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ca&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versió més antiga&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revisió del 10:22, 5 set 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Línia 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	wget -q --output-document=/tmp/$NAMEDNS.ip.min.com.txt &amp;quot;http://ip.min.com/update.php?ps=test&amp;amp;domain=$NAMEDNS&amp;quot; &amp;amp;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	wget -q --output-document=/tmp/$NAMEDNS.ip.min.com.txt &amp;quot;http://ip.min.com/update.php?ps=test&amp;amp;domain=$NAMEDNS&amp;quot; &amp;amp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	PID=$!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	PID=$!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	sleep &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	sleep &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if [ &amp;quot;$(ps ax | grep $PID)&amp;quot; != &amp;quot;&amp;quot; ]; then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if [ &amp;quot;$(ps ax | grep $PID)&amp;quot; != &amp;quot;&amp;quot; ]; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		# kill $PID&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		# kill $PID&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Marti</name></author>
	</entry>
	<entry>
		<id>https://wiki.espai.de/index.php?title=Bash_Scripts&amp;diff=1289&amp;oldid=prev</id>
		<title>Marti: Es crea la pàgina amb « ==Update external DNS==  &lt;pre&gt; #!/bin/bash # Put a symbolic link to this script in  /etc/network/if-up.d/ so that it runs on network change # Also put it in the crontab ...».</title>
		<link rel="alternate" type="text/html" href="https://wiki.espai.de/index.php?title=Bash_Scripts&amp;diff=1289&amp;oldid=prev"/>
		<updated>2014-09-05T10:05:11Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb « ==Update external DNS==  &amp;lt;pre&amp;gt; #!/bin/bash # Put a symbolic link to this script in  /etc/network/if-up.d/ so that it runs on network change # Also put it in the crontab ...».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
==Update external DNS==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Put a symbolic link to this script in  /etc/network/if-up.d/ so that it runs on network change&lt;br /&gt;
# Also put it in the crontab -e&lt;br /&gt;
&lt;br /&gt;
NAMEDNS=&amp;quot;portatilelite&amp;quot;&lt;br /&gt;
SSHKEY=&amp;quot;/home/marti/.ssh/id_dsa&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LOGFILE=&amp;quot;${0}.log&amp;quot;&lt;br /&gt;
LOGFILE=&amp;quot;/home/marti/$(basename $LOGFILE)&amp;quot; #In case the script is run from a symbolic link (ex. /etc/network/if-up.d/), we force another specific folder for the logs&lt;br /&gt;
&lt;br /&gt;
ssh -p23 -o ConnectTimeout=2 -o ConnectionAttempts=1 -i $SSHKEY marti@$NAMEDNS.ip.min.com exit&lt;br /&gt;
# &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
if [ $? -ne 0 ] ; then&lt;br /&gt;
	# echo &amp;quot;$DATE - Cannot connect to $NAMEDNS.ip.min.com&amp;quot; |tee -a $LOGFILE&lt;br /&gt;
&lt;br /&gt;
	wget -q --output-document=/tmp/$NAMEDNS.ip.min.com.txt &amp;quot;http://ip.min.com/update.php?ps=test&amp;amp;domain=$NAMEDNS&amp;quot; &amp;amp;&lt;br /&gt;
	PID=$!&lt;br /&gt;
	sleep 3&lt;br /&gt;
	if [ &amp;quot;$(ps ax | grep $PID)&amp;quot; != &amp;quot;&amp;quot; ]; then&lt;br /&gt;
		# kill $PID&lt;br /&gt;
		kill -s SIGKILL &amp;quot;$PID&amp;quot;&lt;br /&gt;
		echo &amp;quot;$(date +'%Y-%m-%d %H:%M:%S') - Cannot connect to ip.min.com&amp;quot; |tee -a $LOGFILE&lt;br /&gt;
   	else&lt;br /&gt;
		echo &amp;quot;$(date +'%Y-%m-%d %H:%M:%S') - New IP for $NAMEDNS.ip.min.com $(head -n 1 /tmp/$NAMEDNS.ip.min.com.txt)&amp;quot; |tee -a $LOGFILE&lt;br /&gt;
	fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marti</name></author>
	</entry>
</feed>