<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: (轉) [文件]判斷 Local IP 設定不同 locale 的方法</title>
	<atom:link href="http://KnightFeng.org/blog/archives/630/feed" rel="self" type="application/rss+xml" />
	<link>http://KnightFeng.org/blog/archives/630</link>
	<description>What happened with knight during days</description>
	<lastBuildDate>Thu, 23 Jun 2011 11:10:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: 小俠 (Eintisy)</title>
		<link>http://KnightFeng.org/blog/archives/630/comment-page-1#comment-46649</link>
		<dc:creator>小俠 (Eintisy)</dc:creator>
		<pubDate>Thu, 25 Dec 2008 05:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://KnightFeng.org/blog/?p=630#comment-46649</guid>
		<description>附註一：

原 GetLocal.sh 好像可以在 sudo su - (or su -) 裡用
新的 GetLocal.sh 則只能在有 $SSH_CONNECTION 變數時候用。

好像跟 screen 無關。</description>
		<content:encoded><![CDATA[<p>附註一：</p>
<p>原 GetLocal.sh 好像可以在 sudo su &#8211; (or su -) 裡用<br />
新的 GetLocal.sh 則只能在有 $SSH_CONNECTION 變數時候用。</p>
<p>好像跟 screen 無關。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 小俠 (Eintisy)</title>
		<link>http://KnightFeng.org/blog/archives/630/comment-page-1#comment-46648</link>
		<dc:creator>小俠 (Eintisy)</dc:creator>
		<pubDate>Thu, 25 Dec 2008 05:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://KnightFeng.org/blog/?p=630#comment-46648</guid>
		<description>感謝 WanCW 的提醒...
那個 GetLocal.sh 裡的方法，如果是 sshd 的話....
可以換成 $SSH_CONNECTION 比較簡單...


======= filename: GetLocal.sh ======
#!/bin/sh
Report=&quot;$1&quot;
IFS=&quot; &quot;
set -- `echo &quot;$SSH_CONNECTION&quot;`
IP=$3
PORT=$4

# Report
IFS=&quot;&quot;
case $Report in
  &quot;IP&quot;)
    echo &quot;$IP&quot;
    ;;
  &quot;PORT&quot;)
    echo &quot;$PORT&quot;
    ;;
  *)
    echo &quot;MyIP = $IP, Port = $PORT&quot;
    ;;
esac

exit 0

</description>
		<content:encoded><![CDATA[<p>感謝 WanCW 的提醒&#8230;<br />
那個 GetLocal.sh 裡的方法，如果是 sshd 的話&#8230;.<br />
可以換成 $SSH_CONNECTION 比較簡單&#8230;</p>
<p>======= filename: GetLocal.sh ======<br />
#!/bin/sh<br />
Report=&#8221;$1&#8243;<br />
IFS=&#8221; &#8221;<br />
set &#8212; `echo &#8220;$SSH_CONNECTION&#8221;`<br />
IP=$3<br />
PORT=$4</p>
<p># Report<br />
IFS=&#8221;"<br />
case $Report in<br />
  &#8220;IP&#8221;)<br />
    echo &#8220;$IP&#8221;<br />
    ;;<br />
  &#8220;PORT&#8221;)<br />
    echo &#8220;$PORT&#8221;<br />
    ;;<br />
  *)<br />
    echo &#8220;MyIP = $IP, Port = $PORT&#8221;<br />
    ;;<br />
esac</p>
<p>exit 0</p>
]]></content:encoded>
	</item>
</channel>
</rss>

