This commit is contained in:
Austin Eccentrici
2022-07-31 14:10:27 +10:00
parent ce79f41873
commit b92faa1d38
4 changed files with 36 additions and 3 deletions
+28
View File
@@ -0,0 +1,28 @@
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="gallifrey"
plugins=(git)
source $ZSH/oh-my-zsh.sh
clear
local terminal=$(tty 2>/dev/null)
if [[ $terminal == "/dev/tty1" ]]
then
if ping -c 1 gnu.org >/dev/null 2&>1; then
local internal=$(ip -json route get 192.168.1.1 | jq -r '.[].prefsrc')
local external=$(curl -4 icanhazip.com 2>/dev/null)
local user=$(whoami)
printf "Internet connection status: \033[32;1mOK\033[0m\n"
printf "\n"
printf "Internal IP Address: \033[32;1m$internal\033[0m\n"
printf "External IP Address: \033[32;1m$external\033[0m\n"
printf "\n"
printf "Connect using: \033[1mssh $user@$internal\033[0m\n"
printf " \033[1m ssh $user@$external\033[0m\n\n\n"
else
printf "Internet connection status: \033[31;1mBAD\033[0m\n"
printf "Ensure network connection is present and try again.\n"
fi
fi
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2022 xzntrc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-2
View File
@@ -1,2 +0,0 @@
# server-configs
+7
View File
@@ -0,0 +1,7 @@
pacman -Sy
pacman -S openssh jq zsh --noconfirm
systemctl start sshd
systemctl enable sshd
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
rm .zshrc
curl -fsSL https://git.kiwifarms.net/xzntrc/server-configs/src/branch/master/.zshrc