<reponame>vfosnar/sshdev<filename>bashrc.py
#!/usr/bin/env python3
from os import getcwd
from os import getenv
from os import system

from pathlib import Path

if __name__ == "__main__":
    home = Path(getenv("HOME")).resolve()
    cwd = getcwd()

    if(not home):           exit(0)
    if(str(home) != cwd):   exit(0)

    current_file = Path(home, ".sshdev-current")
    
    if(not current_file.exists()): exit(0)

    with open(current_file, "r", encoding="utf-8") as file:
        current = file.read()
    
    system(f"ssh {current}")
#!/usr/bin/env python3
from os import getcwd
from os import getenv
from os import system

from pathlib import Path

if __name__ == "__main__":
    home = Path(getenv("HOME")).resolve()
    cwd = getcwd()

    if(not home):           exit(0)
    if(str(home) != cwd):   exit(0)

    current_file = Path(home, ".sshdev-current")
    
    if(not current_file.exists()): exit(0)

    with open(current_file, "r", encoding="utf-8") as file:
        current = file.read()
    
    system(f"ssh {current}")
#!/usr/bin/env python3