-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestindocker.sh
More file actions
executable file
·112 lines (111 loc) · 3.35 KB
/
testindocker.sh
File metadata and controls
executable file
·112 lines (111 loc) · 3.35 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
# This script is used to test different linux distros with my install script
Ubuntu() {
sudo docker run --rm -v $(pwd):$(pwd) -w $(pwd) -i ubuntu << EOF
apt update && apt install lsb-release python3 curl wget -y
wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -O /bin/systemctl
chmod +x /bin/systemctl
echo "" >> /bin/apt-add-repository # Docker has Universe repo by default
echo y | DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC bash NewInstall.sh -t -n # Auto config TZdata, install packages with no comfirmation
curl -Ssf --keepalive-time 5 --write-out "%{http_code}" localhost/zm/ &> /dev/null # Try to make request
if [ $? != 0 ]; then
exit 1
else
exit 0
fi
EOF
if [ $? != 0 ]; then
echo "Ubuntu Failed!"
ubuntu=false
else
echo "Ubuntu is Working!"
ubuntu=true
fi
}
Alpine() {
sudo docker run --rm -v $(pwd):$(pwd) -w $(pwd) -i alpine << EOF
apk update && apk add wget curl bash openrc python3
mkdir -p /run/openrc/exclusive
touch /run/openrc/softlevel
openrc
echo y | TZ=Etc/UTC bash NewInstall.sh -t -n
curl -Ssf --keepalive-time 5 --write-out "%{http_code}" localhost/zm/ &> /dev/null
if [ $? != 0 ]; then
exit 1
else
exit 0
fi
EOF
if [ $? != 0 ]; then
echo "FAILED!"
alpine=false
else
echo "SUCCESS!"
alpine=true
fi
}
Debian() {
sudo docker run --rm -v $(pwd):$(pwd) -w $(pwd) -i debian << EOF
apt update && apt install curl lsb-release python3 wget -y
wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -O /bin/systemctl
chmod +x /bin/systemctl
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC bash NewInstall.sh -t -n
curl -Ssf --keepalive-time 5 --write-out "%{http_code}" localhost/zm/ &> /dev/null
if [ $? != 0 ]; then
exit 1
else
exit 0
fi
EOF
if [ $? != 0 ]; then
echo "FAILED!"
debian=false
else
echo "SUCCESS!"
debian=true
fi
}
Fedora() {
sudo docker run --rm -v $(pwd):$(pwd) -w $(pwd) -i fedora << EOF
echo "assumeyes=1" >> /etc/dnf/dnf.conf
dnf update && dnf install lsb-release python3 curl wget e2fsprogs -y
wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -O /bin/systemctl
chmod +x /bin/systemctl
echo y | TZ=Etc/UTC bash NewInstall.sh -t -n # Auto config TZdata, install packages with no comfirmation , and pass docker flag to overwrite systemctl
curl -Ssfk --keepalive-time 5 --write-out "%{http_code}" https://localhost/zm/ &> /dev/null # Try to make request
if [ $? != 0 ]; then
exit 1
else
exit 0
fi
EOF
if [ $? != 0 ]; then
echo "FAILED!"
Fedora=false
else
echo "SUCCESS!"
Fedora=true
fi
}
Arch() {
docker run --rm -v $(pwd):$(pwd) -w $(pwd) -i archlinux << EOF
pacman-key --init
pacman -Syu --noconfirm python3 wget curl sudo
wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -O /bin/systemctl
chmod +x /bin/systemctl
echo "root ALL=(ALL:ALL) ALL" >> /etc/sudoers
echo y | TZ=Etc/UTC bash NewInstall.sh -t -n
EOF
}
opensuse() {
docker run --rm -v $(pwd):$(pwd) -w $(pwd) -i opensuse/tumbleweed << EOF
zypper --gpg-auto-import-keys refresh
zypper -n refresh
zypper -n install python3 wget curl sudo
wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -O /bin/systemctl
chmod +x /bin/systemctl
echo "root ALL=(ALL:ALL) ALL" >> /etc/sudoers
echo y | TZ=Etc/UTC bash NewInstall.sh -t -n
EOF
}
$1