Files
dragonpilot/scripts/sshkey_installer.py
Dragonpilot Team 811fd5086f dragonpilot v2023.02.08 for EON/C2
version: dragonpilot v2023.02.08 release for EON/C2
date: 2023-02-08T05:01:31
dp-dev(priv2) beta2 commit: f770882b7f
2023-02-08 05:04:53 +00: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")