diff --git a/NetworkManager/NetworkManager.conf b/NetworkManager/NetworkManager.conf new file mode 100644 index 0000000..4d14ee7 --- /dev/null +++ b/NetworkManager/NetworkManager.conf @@ -0,0 +1,6 @@ +[main] +plugins=ifnet,keyfile + +[ifnet] +managed=true +auto_refresh=false diff --git a/NetworkManager/dispatcher.d/.keep_net-misc_networkmanager-0 b/NetworkManager/dispatcher.d/.keep_net-misc_networkmanager-0 new file mode 100644 index 0000000..e69de29 diff --git a/NetworkManager/dispatcher.d/10-openrc-status b/NetworkManager/dispatcher.d/10-openrc-status new file mode 100755 index 0000000..06b22bd --- /dev/null +++ b/NetworkManager/dispatcher.d/10-openrc-status @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (c) 2012 Alexandre Rostovtsev +# Released under the 2-clause BSD license. + +# Ensures that the NetworkManager OpenRC service is marked as started and +# providing net only when it has a successful connection. + +if [ ! -e "/run/openrc/softlevel" ]; then + # OpenRC is not running + exit 0 +fi + +# Ensure rc-service is in PATH +PATH="${PATH}:/sbin:/usr/sbin" + +# Exit if the NetworkManager OpenRC service is not running +rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0 + +# Call rc-service in background mode so that the start/stop functions update +# NetworkManager service status to started or inactive instead of actually +# starting or stopping the daemon +export IN_BACKGROUND=YES + +case "$2" in + up) nm-online -t 0 -x && + ! rc-service NetworkManager status 2>&1 | grep -q started && + exec rc-service NetworkManager start ;; + down) nm-online -t 0 -x || + rc-service NetworkManager status 2>&1 | grep -q stopped || + exec rc-service NetworkManager stop ;; + pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped || + exec rc-service NetworkManager stop ;; +esac +exit 0 +# vim: set ts=4: diff --git a/NetworkManager/system-connections/.keep_net-misc_networkmanager-0 b/NetworkManager/system-connections/.keep_net-misc_networkmanager-0 new file mode 100644 index 0000000..e69de29 diff --git a/conf.d/NetworkManager b/conf.d/NetworkManager new file mode 100644 index 0000000..4a99229 --- /dev/null +++ b/conf.d/NetworkManager @@ -0,0 +1,4 @@ +# If NetworkManager does not establish a connection within $INACTIVE_TIMEOUT +# seconds after starting, the service will be marked as inactive, and it will +# continue to wait for a connection in background mode. +INACTIVE_TIMEOUT=1 diff --git a/conf.d/net b/conf.d/net index f3d6ff3..17480b7 100644 --- a/conf.d/net +++ b/conf.d/net @@ -2,8 +2,8 @@ # scripts in /etc/init.d. To create a more complete configuration, # please review /usr/share/doc/openrc/net.example and save your configuration # in /etc/conf.d/net (this file :]!). -#config_eth1="192.168.0.12 netmask 255.255.255.0 brd 192.168.0.255" -#routes_eth1="default via 192.168.0.1" +config_eth1="192.168.0.12 netmask 255.255.255.0 brd 192.168.0.255" +routes_eth1="default via 192.168.0.1" #routes_eth0="default via 192.168.0.1 #10.0.0.0/8 via 192.168.0.1 #::/0" diff --git a/dbus-1/system.d/nm-avahi-autoipd.conf b/dbus-1/system.d/nm-avahi-autoipd.conf new file mode 100644 index 0000000..485ab42 --- /dev/null +++ b/dbus-1/system.d/nm-avahi-autoipd.conf @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/dbus-1/system.d/nm-dhcp-client.conf b/dbus-1/system.d/nm-dhcp-client.conf new file mode 100644 index 0000000..0aeae60 --- /dev/null +++ b/dbus-1/system.d/nm-dhcp-client.conf @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/dbus-1/system.d/nm-dispatcher.conf b/dbus-1/system.d/nm-dispatcher.conf new file mode 100644 index 0000000..fd2f0e5 --- /dev/null +++ b/dbus-1/system.d/nm-dispatcher.conf @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/dbus-1/system.d/org.freedesktop.NetworkManager.conf b/dbus-1/system.d/org.freedesktop.NetworkManager.conf new file mode 100644 index 0000000..5e7bafa --- /dev/null +++ b/dbus-1/system.d/org.freedesktop.NetworkManager.conf @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/init.d/NetworkManager b/init.d/NetworkManager new file mode 100755 index 0000000..8465449 --- /dev/null +++ b/init.d/NetworkManager @@ -0,0 +1,57 @@ +#!/sbin/runscript +# Copyright (c) 2008 Saleem Abdulrasool +# Distributed under the terms of the GNU General Purpose License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/init.d.NetworkManager,v 1.1 2013/01/28 07:05:05 tetromino Exp $ + +description="NetworkManager daemon. The service is marked as started only \ +when a network connection is established." + +depend() { + need dbus + provide net +} + +start() { + # If we are re-called by a dispatcher event, we want to mark the service + # as started without starting the daemon again + yesno "${IN_BACKGROUND}" && return 0 + + [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1" + + ebegin "Starting NetworkManager" + start-stop-daemon --start --quiet --pidfile /run/NetworkManager/NetworkManager.pid \ + --exec /usr/sbin/NetworkManager -- --pid-file /run/NetworkManager/NetworkManager.pid + local _retval=$? + eend "${_retval}" + if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then + einfo "Marking NetworkManager as inactive. It will automatically be marked" + einfo "as started after a network connection has been established." + mark_service_inactive + fi + return "${_retval}" +} + +stop() { + # If we are re-called by a dispatcher event, we want to mark the service + # as inactive without stopping the daemon + if yesno "${IN_BACKGROUND}"; then + mark_service_inactive "${SVCNAME}" + return 0 + fi + + ebegin "Stopping NetworkManager" + local pidfile=/run/NetworkManager/NetworkManager.pid + if [ ! -e "${pidfile}" ] && [ -e /var/run/NetworkManager.pid ]; then + # Try stopping the pid file used by <0.9.7 + pidfile=/var/run/NetworkManager.pid + start-stop-daemon --stop --quiet --pidfile "${pidfile}" + ret=$? + [ ${ret} = 0 ] && [ -e "${pidfile}" ] && rm "${pidfile}" + eend ${ret} + else + start-stop-daemon --stop --quiet --pidfile "${pidfile}" + eend $? + fi +} + +# vim: set ft=gentoo-init-d ts=4 : diff --git a/resolv.conf b/resolv.conf index 275a3b1..784c264 100644 --- a/resolv.conf +++ b/resolv.conf @@ -1,7 +1,7 @@ -# Generated by dhcpcd +# Generated by dhcpcd from eth1, eth1:dhcp6, eth1:ra # /etc/resolv.conf.head can replace this line -# /etc/resolv.conf.tail can replace this line nameserver 192.168.0.1 nameserver 192.168.0.2 nameserver 2a02:908:2:1108::11 nameserver 2a02:908:2:1107::11 +# /etc/resolv.conf.tail can replace this line diff --git a/tor/torrc b/tor/torrc index b0cfb81..2a5aa92 100644 --- a/tor/torrc +++ b/tor/torrc @@ -29,7 +29,7 @@ SocksPort 9050 # Default: Bind to localhost:9050 for local connections. ## can access your SocksPort may be able to learn about the connections ## you make. SocksPolicy accept 127.0.0.1 -SocksPolicy accept 192.168.4.5 +SocksPolicy accept 192.168.0.12 SocksPolicy accept 192.168.4.8 SocksPolicy reject *