Last active
February 8, 2019 13:28
-
-
Save vibragiel/af5bc605c54ecd270dd837e4da1b1e0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install F-Droid, Termux, Termux:API and Termux:Boot. Then open a Termux session and: | |
# pkg install curl && curl https://gist.github.com/gist_id | bash | |
PUBLIC_SSH_KEY_URL="https://gabi.is/[email protected]" | |
pkg install openssh termux-api dnsutils | |
mkdir -p ~/.termux/boot/ ~/.ssh | |
[ -f ~/.termux/boot/daemons.sh ] || cat >~/.termux/boot/daemons.sh <<EOL | |
#!/data/data/com.termux/files/usr/bin/bash | |
termux-wake-lock | |
if ! pgrep "sshd" >/dev/null; then echo "[Starting sshd...]" && sshd && echo "[sshd started...]"; else echo "[sshd is running]"; fi | |
if ! pgrep "crond" >/dev/null; then echo "[Starting crond...]" && crond && echo "[crond started...]"; else echo "[crond is running]"; fi | |
EOL | |
curl $PUBLIC_SSH_KEY_URL >> ~/.ssh/authorized_keys | |
bash ~/.termux/boot/daemons.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment