Created
May 17, 2021 09:52
-
-
Save iamramahibrah/834021f28088434d51515ad5af4aa19f 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
#!/bin/bash | |
#===================================== | |
# OPEN SSH SERVER UPGRADE SCRIPT | |
#===================================== | |
function colors() | |
{ | |
RED="\033[1;31m" | |
GREEN="\033[1;32m" | |
BLUE='\033[34;1m' | |
YELLOW='\033[33;1m' | |
NOCOLOR="\033[0m" | |
} | |
colors | |
function root() | |
{ | |
if [[ $EUID -ne 0 ]]; then | |
echo -e "$RED This script must be run as root $NOCOLOR" | |
exit 1 | |
fi | |
} | |
root | |
function update() | |
{ | |
if ping -q -c 1 -w 1 8.8.8.8 >/dev/null; then | |
echo -e " Internet $GREEN ● $NOCOLOR " | |
sudo apt update | |
sudo apt install --only-upgrade openssh-server -y | |
else | |
echo -e " Internet $RED ● $NOCOLOR" | |
fi | |
} | |
update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment