Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- saveInterfaceSetup()
- {
- INTERFACE="$1"
- # Dougal: use HWaddress for the config files!
- #HWADDRESS=`cat /sys/class/net/$1/address | tr a-z A-Z`
- # need to address from ifconfig, for firewire (/sys.../address gives 24-bit)
- HWADDRESS=$(ifconfig "$1" | grep "^$1" | tr -s ' ' | cut -d' ' -f5)
- # create config file
- #if [ -e "/tmp/wireless-config" ] ; then
- if checkIfIsWireless "$INTERFACE" ; then
- # Dougal: only need to do this once
- if [ ! -s "${WLAN_INTERFACES_DIR}/$HWADDRESS.conf" ] ; then
- #cp -a /tmp/wireless-config "${WLAN_INTERFACES_DIR}/$HWADDRESS.conf"
- echo -e "INT_WPA_DRV='$PROFILE_WPA_DRV'\nUSE_WLAN_NG='$USE_WLAN_NG'" > ${WLAN_INTERFACES_DIR}/$HWADDRESS.conf
- fi
- # create interface config file
- echo "IS_WIRELESS='$IS_WIRELESS'" > ${NETWORK_INTERFACES_DIR}/$HWADDRESS.conf
- # Dougal: add info for static ip to profile, in case we use it
- # (note that -- currently at least -- that's the only use for MODECOMMANDS)
- #### (I am assuming the profile variable is still set...)
- # Need to clean up old info before adding new (pointed out by PaulBx1)
- sed -i '/^STATIC_IP=.*/d ; /^IP_ADDRESS=.*/d ; /^NETMASK=.*/d ; /DNS_SERVER^.*/d ; /^GATEWAY=.*/d ' "${PROFILES_DIR}/${PROFILE_AP_MAC}.${PROFILE_ENCRYPTION}.conf"
- echo -e "${MODECOMMANDS}" >>"${PROFILES_DIR}/${PROFILE_AP_MAC}.${PROFILE_ENCRYPTION}.conf"
- else
- #echo -e "${MODECOMMANDS}" > /etc/${INTERFACE}mode
- # Dougal: maybe append? in case used both for dhcp and static.
- echo -e "${MODECOMMANDS}\nIS_WIRELESS=''" > ${NETWORK_INTERFACES_DIR}/$HWADDRESS.conf
- fi
- } # end saveInterfaceSetup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement