#! /usr/bin/python
# -*-coding:utf-8-*-
from pamac import common, transaction
if not common.pid_file_exists():
print('checking updates')
common.write_pid_file()
try:
transaction.Refresh()
transaction.StopDaemon()
except:
pass
finally:
common.rm_pid_file()
print('check updates done')