blob: 6d4e9ec3dc90e33a89195da39aa78acb166874b9 [file] [log] [blame] [edit]
#!/usr/bin/env python3
# Copyright 2019 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import sys
import dbus
import flimflam
if len(sys.argv) < 2:
print('Usage: %s <device | interface>' % sys.argv[0])
sys.exit(1)
name = sys.argv[1]
flim = flimflam.FlimFlam(dbus.SystemBus())
device = flim.FindElementByNameSubstring('Device', name)
if device is None:
device = flim.FindElementByPropertySubstring('Device', 'Interface', name)
print('Disabling device %s' % device.object_path)
device.Disable()