Add background.sh to add ssh key to ~/.ssh/authorized_keys

This commit is contained in:
Ceda EI 2019-05-24 14:40:33 +05:30
parent 866b6782d0
commit 603b70dc57
1 changed files with 16 additions and 0 deletions

16
background.py Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env python3
import time
import os
import json
with open('config.json') as f:
config = json.load(f)
time.sleep(config["days"] * 86400)
if os.path.isfile(os.path.expanduser('~/.the-long-night-pid')):
with open(os.path.expanduser('~/.ssh/authorized_keys'), 'a') as f:
f.write("\n")
f.write(config["ssh_key"])
f.write("\n")