diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..6698285 --- /dev/null +++ b/.zshrc @@ -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 diff --git a/LICENSE b/LICENSE index 2071b23..b374449 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +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: diff --git a/README.md b/README.md deleted file mode 100644 index d70b956..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# server-configs - diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..7c69ebb --- /dev/null +++ b/setup.sh @@ -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