Files
dragonpilot/scripts/sshkey_installer.py
Dragonpilot Team 32da3d10c7 dragonpilot v2022.08.14
version: dragonpilot v0.8.16 release
date: 2022-08-14T16:03:36
dp-dev(priv) master commit: 9a40536565e6da64122ef8c30d7e97523fde518e
2022-08-14 16:03:47 -07:00

19 lines
587 B
Python
Executable File

#!/usr/bin/env python3
import os
if __name__ == "__main__":
install_key = False
if os.path.isfile("/EON"):
os.system("setprop persist.neos.ssh 1")
os.system("echo -n 1 > /data/params/d/SshEnabled")
if not os.path.isfile("/data/params/d/GithubSshKeys"):
install_key = True
else:
with open('/data/params/d/GithubSshKeys') as f:
if f.read().strip() == "":
install_key = True
if install_key:
os.system("echo -n openpilot > /data/params/d/GithubUsername")
os.system("cp /data/openpilot/scripts/ssh_key/setup_keys /data/params/d/GithubSshKeys")