This repository was archived by the owner on Aug 23, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathuls_install.sh
More file actions
93 lines (75 loc) · 2.55 KB
/
Copy pathuls_install.sh
File metadata and controls
93 lines (75 loc) · 2.55 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6+, Debian 7+, Ubuntu 14+ #
# Description: Install ULS #
# Author: @CYRO4S #
# Intro: https://github.com/CYRO4S/Universal-Linux-Script #
#=================================================================#
# Get CentOS version
function GetCentosVersion(){
local code=$1
local version="`GetVersion`"
local main_ver=${version%%.*}
if [ $main_ver == $code ];then
return 0
else
return 1
fi
}
# Install on Debian, Ubuntu 14+
function InstallDeb() {
echo "Updating source..."
apt-get update
echo "Installing required packages..."
apt-get -y install python3 virt-what
echo "Downloading ULS..."
mkdir /usr/share/uls/
wget --no-check-certificate -O /usr/share/uls/uls.py https://raw.githubusercontent.com/CYRO4S/Universal-Linux-Script/master/uls.py && chmod +x /usr/share/uls/uls.py
echo "Let's make ULS a true command..."
ln /usr/share/uls/uls.py /usr/bin/uls
clear
echo "Let ULS get your system information..."
uls --getinfo
echo "All done."
echo "Now use 'uls [Path-to-ULS-script]' to run a ULS script."
}
# Install on CentOS 7+
function InstallCent() {
echo "Installing required packages..."
yum -y install epel-release
yum -y install python34 virt-what
echo "Downloading ULS..."
mkdir /usr/share/uls/
wget --no-check-certificate -O /usr/share/uls/uls.py https://raw.githubusercontent.com/CYRO4S/Universal-Linux-Script/master/uls.py && chmod +x /usr/share/uls/uls.py
echo "Let's make ULS a true command..."
ln /usr/share/uls/uls.py /usr/bin/uls
clear
echo "Let ULS get your system information..."
uls --getinfo
echo "All done."
echo "Now use 'uls [Path-to-ULS-script]' to run a ULS script."
}
# Get distro
function GetDist(){
if [ -f /etc/redhat-release ];then
if GetCentosVersion 5; then
echo "CentOS 5 is not supported. Auto-Install aborted."
exit 1
else
InstallCent
fi
elif [ ! -z "`cat /etc/issue | grep bian`" ];then
InstallDeb
elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then
InstallDeb
else
echo "Distribution not supported. Auto-Install aborted."
echo "Try installing manually"
exit 1
fi
}
# Initialization step
clear
GetDist