mirror of
https://gitlab.com/ceda_ei/the-long-night
synced 2025-04-19 16:16:52 +02:00
Add background.sh to add ssh key to ~/.ssh/authorized_keys
This commit is contained in:
parent
866b6782d0
commit
603b70dc57
16
background.py
Normal file
16
background.py
Normal 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")
|
Loading…
x
Reference in New Issue
Block a user