平衡点
2011/07/20
_ Wicd -> Network Manager
「固定 IP も設定できるよ!」と聞いたので, wicd から Network Manager に戻ってみた.
手元 laptop は
- 家の無線LAN: DHCP
- 大学内の居室および居室のある建物: 固定 IP + proxy
- 大学内の他の建物: DHCP + proxy
なんて事になっていて, 以前書いた(mobile 環境での proxy の proxy)ように, 手元の proxy の設定も NetworkManager での接続時にきりかえられないモンかな, とかジタバタしてみた.
設定スクリプトは /etc/NetworkManager/dispatcher.d/ 以下に置く, というので イケルみたい. とりあえず
#!/bin/sh
# -*- mode: sh; coding: utf-8-unix; indent-tabs-mode: nil -*-
# 99_switch_squid_proxy
#
# Copyright(C) Youhei SASAKI All rights reserved.
# $Lastupdate: 2011/07/19 21:25:27$
#
# Author: Youhei SASAKI <uwabami@gfd-dennou.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Code:
INTERFACE=$1
STATUS=$2
cp /etc/squid/squid-direct.conf /etc/squid/squid.conf
pdnsd-ctl empty-cache math.kyoto-u.ac.jp
if [ "$STATUS" = "up" ] ; then
case "$IP4_ADDRESS_0" in
10.226.141.*|10.226.142.*|10.226.165.*)
cp /etc/squid/squid-kusm.conf /etc/squid/squid.conf
;;
*)
;;
esac
fi
/etc/init.d/squid reload
なんて書いてみて, お茶濁す.
/etc/network/if-up.d とかに置いておく方が良いのかな? こっちもちゃんと見るのかしらん.
[ツッコミを入れる]