-
Notifications
You must be signed in to change notification settings - Fork 4
/
update.sh
executable file
·38 lines (32 loc) · 1.01 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
if [[ $1 == '-v' ]]; then
echo "===> running in verbose mode"
set -x
fi
source /etc/os-release
# apt-based Operating Systems
if [ $ID == 'debian' ]; then
echo "###########################"
echo "Update System Package List"
echo "###########################"
sudo apt-get -y update
echo "##############################################"
echo "Upgrade installed packages to latest versions"
echo "##############################################"
sudo apt-get -y dist-upgrade
echo "###################"
echo "Upgrade ssh server"
echo "###################"
sudo apt-get -y install openssh-server
echo "#############################################"
echo "Last Updated:" $(date)
echo "#############################################"
# dnf-based Operating Systems
elif [ $ID == 'fedora' ] || [ $ID == 'rhel' ]; then
sudo dnf -y upgrade
echo "##########################################"
echo "Last Updated:" $(date)
echo "##########################################"
else
echo "Unknown Distro: $ID"
fi