Commit ca12e0d6 by Czémán Arnold

freebsd: remove rc.subr modification, instead add 'network' and 'routing' scripts

parent d0221951
......@@ -31,16 +31,7 @@ then
git clone https://github.com/opntr/bme-cloud-circle-agent.git agent
fi
grep "If a service" /etc/rc.subr
ret=$?
if [ $ret -eq 0 ]
then
echo "patching /etc/rc.subr ..."
(
cd /etc
patch -p0 < /root/agent/bootstrap/freebsd/fix-rc.subr.diff
)
fi
cp -r bootstrap/freebsd/rc.conf.d /etc
cd /root/agent
if [ -d /usr/local/etc/rc.d ]
......
--- rc.subr.orig 2014-12-18 21:07:36.000000000 +0100
+++ rc.subr 2014-12-18 21:27:58.000000000 +0100
@@ -1330,24 +1330,17 @@
_rc_conf_loaded=true
fi
- # If a service name was specified, attempt to load
- # service-specific configuration
- if [ -n "$_name" ] ; then
- for _d in /etc ${local_startup%*/rc.d}; do
- if [ -f ${_d}/rc.conf.d/"$_name" ]; then
- debug "Sourcing ${_d}/rc.conf.d/$_name"
- . ${_d}/rc.conf.d/"$_name"
- elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then
- local _rc
- for _rc in ${_d}/rc.conf.d/"$_name"/* ; do
- if [ -f "$_rc" ] ; then
- debug "Sourcing $_rc"
- . "$_rc"
- fi
- done
- fi
- done
- fi
+ for _d in /etc ${local_startup%*/rc.d}; do
+ if [ -d ${_d}/rc.conf.d ] ; then
+ local _rc
+ for _rc in ${_d}/rc.conf.d/* ; do
+ if [ -f "$_rc" ] ; then
+ debug "Sourcing $_rc"
+ . "$_rc"
+ fi
+ done
+ fi
+ done
# Set defaults if defined.
for _var in $rcvar $rcvars; do
for netconf in /etc/rc.conf.d/ifconfig_*
do
load_rc_config $(basename "$netconf")
done
......@@ -24,7 +24,7 @@ def get_interfaces_freebsd(interfaces):
def remove_interfaces_freebsd(devices):
for device in devices:
if_file = rcconf_dir + device
if_file = "%s/ifconfig_%s" % (rcconf_dir, device)
if os.path.isfile(if_file):
logger.debug("remove interface configuration: " + if_file)
os.unlink(if_file)
......@@ -35,7 +35,6 @@ def remove_interfaces_freebsd(devices):
def change_ip_freebsd(interfaces, dns):
data = list(get_interfaces_freebsd(interfaces))
for ifname, conf in data:
subprocess.call(('/usr/sbin/service', 'netif', 'stop', ifname))
remove_interfaces_freebsd(dict(data).keys())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment