Updated methode of adding repo's

This commit is contained in:
2020-09-24 12:13:05 +02:00
parent adbb03e62f
commit 9e9487c597
7 changed files with 49 additions and 16 deletions

View File

@@ -7,12 +7,12 @@
sed -i -e 's/magenta/blue/g' /etc/newt/palette
if [ "$1" != "-l" ]; then
PKGM="debconf-apt-progress -- apt"
APTMODE="debconf-apt-progress -- apt"
OUTPUT='/dev/null'
IMODE=n
fi
if [ "$1" = "-l" ]; then
PKGM="apt"
APTMODE="apt"
OUTPUT='/dev/tty'
IMODE=l
fi
@@ -32,8 +32,43 @@ PHPMyadmin=1 #Overwriten by cms's without php
sqlver=8.0
TestMode=0
#PackageManager-config
PKGA="add-apt-repository --no-update"
PKGI="${PKGM} install -y --no-install-recommends"
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
echo "Ubuntu 18.04 Detected"
PKGM="$APTMODE"
shortdist=ubu1804
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
echo "Ubuntu 20.04 Detected"
PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends"
echo "This os in not supported"
exit
shortdist=ubu2004
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
echo "Debian 10 Detected"
PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt.list"
shortdist=deb10
echo "This os in not supported"
exit
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
echo "Centos 8 Detected"
PKGM="dnf"
PKGLIST="dnf.list"
shortdist=cent8
echo "This os in not supported"
exit
else
echo "This os in not supported"
exit
fi
unset dist_ver dist APTMODE
##-------------##
# Test-Vars #
@@ -311,7 +346,7 @@ printf " " >>/tmp/apt.list
mkdir -p /etc/ICTM/sites
echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list
for storeme in PKGM PKGA PKGI OUTPUT IMODE repo branch branchtype webserv phpver sqlver PHPMyadmin email hostname; do
for storeme in PKGM PKGI OUTPUT IMODE repo branch branchtype webserv phpver sqlver PHPMyadmin email hostname; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list
done