Dateien nach "template" hochladen

This commit is contained in:
Peter Reichart 2024-09-23 07:55:35 +00:00
parent 99baa35d0a
commit d49f449f2e
3 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,48 @@
#!/bin/bash
# Current Hostname
CHOST=$(hostname)
# Search parameters
DEFNAME=template
DEFDOM=local.tld
errormsg() {
echo "Bitte Hostnamen und Domain angeben: $0 <hostname> <domain>"
exit 0
}
# check hostname
if [[ -z "$1" ]]; then
errormsg
else
HNAME=$1
fi
# check domain
if [[ -z "$2" ]]; then
errormsg
else
DOMNAME=$2
fi
# Domain
FQDN=${HNAME}.${DOMNAME}
# Status:
echo "------------------------------------------------------"
echo "Aktueller Hostname (hostname -f): $(hostname -f)"
echo " (cat /etc/hostname): $(cat /etc/hostname)"
echo "Ersetzungs-Suchmuster : ${DEFNAME}.${DEFDOM}"
echo "neuer Hostname : ${FQDN}"
echo "------------------------------------------------------"
echo
echo "<press Enter>"
read
sed -i -e "s/${DEFNAME}.${DEFDOM}/${FQDN}/g" /etc/exim4/update-exim4.conf.conf
sed -i -e "s/${DEFNAME}.${DEFDOM}/${FQDN}/g" /etc/hosts
sed -i -e "s/${DEFNAME}/${HNAME}/g" /etc/hosts
sed -i -e "s/${DEFNAME}.${DEFDOM}/${FQDN}/g" /etc/mailname
sed -i -e "s/${DEFNAME}/${HNAME}/g" /etc/hostname

25
template/initDocker.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/sh
apt update
apt install -y curl
DOCKERDIR=/docker
mkdir -p $DOCKERDIR
ln $DOCKERDIR /root/docker -s
curl -k -o $DOCKERDIR/setupDocker.sh https://get.docker.com
chmod +x $DOCKERDIR/setupDocker.sh
echo "
------------------------------------------------------------------------------
Docker Einrichtung:
Docker Verzeichnis : /docker -> Symbolischer Link in /root!
Docker install-Skript: /docker/setupDocker.sh -> Install-/Updateskript
------------------------------------------------------------------------------
"

View File

@ -0,0 +1,9 @@
#!/bin/sh
. /etc/os-release
echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" > /etc/apt/sources.list.d/backports.list
apt update ; apt install -t ${VERSION_CODENAME}-backports cockpit