平衡点


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 とかに置いておく方が良いのかな? こっちもちゃんと見るのかしらん.


連絡先など
最近の日記
一覧
2006|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|02|03|04|08|09|10|11|12|
2013|01|02|03|04|05|06|08|09|10|11|12|
2014|01|02|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|09|10|
2016|02|03|
2017|01|02|03|05|06|07|09|11|12|
2018|03|06|07|10|11|12|
2019|01|02|03|04|05|07|10|12|
2020|01|02|03|04|05|08|09|10|11|12|
2021|01|02|03|05|06|07|08|09|11|12|
2022|01|02|03|04|05|06|08|10|11|12|
2023|02|03|04|06|08|09|11|12|
2024|01|02|03|
Back to Top ▲