1
0
mirror of https://github.com/openSUSE/snapper.git synced 2026-02-06 18:46:06 +01:00
Files
snapper/examples/python/lock-config.py

25 lines
428 B
Python
Executable File

#!/usr/bin/python3
from time import sleep
import dbus
bus = dbus.SystemBus()
snapper = dbus.Interface(bus.get_object('org.opensuse.Snapper', '/org/opensuse/Snapper'),
dbus_interface='org.opensuse.Snapper')
snapper.LockConfig("root")
print("locked")
snapper.LockConfig("root")
snapper.UnlockConfig("root")
print("still locked")
sleep(10)
snapper.UnlockConfig("root")
print("unlocked")
sleep(10)