blob: 86e7ef7d985e094aa049ff79c31b018ad449f47c [file] [log] [blame]
#!/usr/bin/env python3
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# 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 or sys.argv[1] not in ('true', 'false'):
print('Usage: %s true|false' % (sys.argv[0]))
sys.exit(1)
use_swanctl_driver = sys.argv[1] == 'true'
flim = flimflam.FlimFlam(dbus.SystemBus())
def print_current_value(prompt):
if flim.GetUseSwanctlDriver():
print('%s: using swanctl-based driver (NewL2TPIPsecDriver)' % prompt)
else:
print('%s: using stroke-based driver (L2TPIPsecDriver)' % prompt)
print_current_value('Before change')
flim.SetUseSwanctlDriver(use_swanctl_driver)
print_current_value('After change')
print('Restart shill to activate the change.')