-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathupdate_linux.sh
More file actions
51 lines (46 loc) · 1.32 KB
/
update_linux.sh
File metadata and controls
51 lines (46 loc) · 1.32 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
export PACKAGES="$PT_names"
export RESULT_FILE="$PT_result_file"
export LOG_FILE="$PT_log_file"
if [[ -z "$LOG_FILE" ]]; then
export LOG_FILE="/var/log/patching.log"
fi
if [[ -z "$RESULT_FILE" ]]; then
export RESULT_FILE="/var/log/patching.json"
fi
if [[ ! -e "$LOG_FILE" ]]; then
touch "$LOG_FILE"
fi
if [[ ! -e "$RESULT_FILE" ]]; then
touch "$RESULT_FILE"
fi
# Run our OS tests, export OS_RELEASE
source "${PT__installdir}/patching/files/bash/os_test.sh"
# default
STATUS=0
case $OS_RELEASE in
################################################################################
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON)
# RedHat variant
source "${PT__installdir}/patching/files/bash/update_rh.sh"
STATUS=$?
;;
################################################################################
DEBIAN | UBUNTU)
# Debian variant
source "${PT__installdir}/patching/files/bash/update_deb.sh"
STATUS=$?
;;
################################################################################
SLES)
# SUSE variant
source "${PT__installdir}/patching/files/bash/update_sles.sh"
STATUS=$?
;;
################################################################################
*)
echo "Unknown Operating System: ${OS_RELEASE}"
STATUS=2
;;
esac
exit $STATUS