From ee1a3085f467c3926c096a81c47238921af1cc53 Mon Sep 17 00:00:00 2001 From: simono41 Date: Fri, 2 Aug 2019 14:54:43 +0200 Subject: [PATCH] beautysh --- debian-lvm-reinstall-script.sh | 94 +++++++++++++++++----------------- mobilfetch_de.sh | 2 +- mobilfetch_en.sh | 2 +- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/debian-lvm-reinstall-script.sh b/debian-lvm-reinstall-script.sh index 0786d0a..4482f7a 100644 --- a/debian-lvm-reinstall-script.sh +++ b/debian-lvm-reinstall-script.sh @@ -20,11 +20,11 @@ echo "Als root Angemeldet" while (( "$#" )) do for wort in ${1} - do - echo "$wort" - export ${wort%=*}=${wort#*=} - echo "Parameter ${wort%=*} = ${wort#*=}" - done + do + echo "$wort" + export ${wort%=*}=${wort#*=} + echo "Parameter ${wort%=*} = ${wort#*=}" + done shift done @@ -36,69 +36,69 @@ sudo modprobe dm-mirror # Lädt den "mirror"-Treiber welcher für pvmove notwend function makebackup() { -mkdir tmpstorage -mount ${device} tmpstorage -mkdir target -mount ${target} target -tar -czf tmpstorage/backup.tar.gz target/* -umount target -umount tmpstorage + mkdir tmpstorage + mount ${device} tmpstorage + mkdir target + mount ${target} target + tar -czf tmpstorage/backup.tar.gz target/* + umount target + umount tmpstorage } function makelvm() { -pvcreate ${device} -pvcreate ${device1} -pvdisplay -vgcreate server0 ${device} -lvcreate -L50G --name=ext4 server0 -lvcreate -L50G --name=xzf server0 + pvcreate ${device} + pvcreate ${device1} + pvdisplay + vgcreate server0 ${device} + lvcreate -L50G --name=ext4 server0 + lvcreate -L50G --name=xzf server0 -parted /dev/server0/ext4 set 1 raid on -parted /dev/server1/ext4 set 1 raid on + parted /dev/server0/ext4 set 1 raid on + parted /dev/server1/ext4 set 1 raid on -mdadm --create /dev/md0 --auto md --level=1 --raid-devices=2 /dev/server0/ext4 /dev/server1/ext4 + mdadm --create /dev/md0 --auto md --level=1 --raid-devices=2 /dev/server0/ext4 /dev/server1/ext4 -vgcreate server1 ${device1} -lvcreate -L50G --name=ext4 server1 -lvcreate -L50G --name=xfs server1 + vgcreate server1 ${device1} + lvcreate -L50G --name=ext4 server1 + lvcreate -L50G --name=xfs server1 -parted /dev/server0/xfs set 1 raid on -parted /dev/server1/xfs set 1 raid on + parted /dev/server0/xfs set 1 raid on + parted /dev/server1/xfs set 1 raid on -mdadm --create /dev/md0 --auto md --level=1 --raid-devices=2 /dev/server0/xfs /dev/server1/xfs + mdadm --create /dev/md0 --auto md --level=1 --raid-devices=2 /dev/server0/xfs /dev/server1/xfs -mkfs -L p_debian_ext4 -t ext4 /dev/md0 + mkfs -L p_debian_ext4 -t ext4 /dev/md0 -mkfs -L p_debian_xfs -t xfs /dev/md1 + mkfs -L p_debian_xfs -t xfs /dev/md1 } function bindsym() { -mount /dev/md0 target -cd target -mkdir boot -mount ${device} boot -mkdir sys proc dev -mount --bind /sys sys -mount --bind /dev dev -mount --bind /proc proc + mount /dev/md0 target + cd target + mkdir boot + mount ${device} boot + mkdir sys proc dev + mount --bind /sys sys + mount --bind /dev dev + mount --bind /proc proc } function restorebackup() { -tar -xzf backup.tar.gz -C target + tar -xzf backup.tar.gz -C target } function repairbootloader() { -deviceuuid=$(blkid -s UUID -o value ${device}) -echo ${deviceuuid} >> target/etc/fstab -echo "Bitte nochmal nachschauen ob noch alte Einträge entfernt werden müssen!!!" -echo "SystemD suckt total sonst rum ^^" -echo "/etc/mkinitcpio.conf in Hooks einfügen lvm2 vor filesystem" + deviceuuid=$(blkid -s UUID -o value ${device}) + echo ${deviceuuid} >> target/etc/fstab + echo "Bitte nochmal nachschauen ob noch alte Einträge entfernt werden müssen!!!" + echo "SystemD suckt total sonst rum ^^" + echo "/etc/mkinitcpio.conf in Hooks einfügen lvm2 vor filesystem" -chroot target aptitude install lvm2 -chroot target grub-install ${device%?} -chroot target update-grub -chroot target dpkg-reconfigure linux-image-mylinuxversion + chroot target aptitude install lvm2 + chroot target grub-install ${device%?} + chroot target update-grub + chroot target dpkg-reconfigure linux-image-mylinuxversion } diff --git a/mobilfetch_de.sh b/mobilfetch_de.sh index 76613a1..e07d13e 100755 --- a/mobilfetch_de.sh +++ b/mobilfetch_de.sh @@ -37,7 +37,7 @@ echo -e "\033[1;33m Systemzeit: \033[0m" `date | awk '{print $4}'` echo -e "\033[1;33m Online seit: \033[0m" `uptime | awk '{print $3}'` "Stunden" echo -e "\033[1;33m Speichernutzung: \033[0m" `cat /proc/meminfo|grep 'MemF'| awk '{print $2}'` "kB von" `cat /proc/meminfo|grep 'MemT'| awk '{print $2}'` "kB frei" if [ -f /sys/class/thermal/thermal_zone0/temp ]; then -echo -e "\033[1;33m CPU-Temp: \033[0m" `cat /sys/class/thermal/thermal_zone0/temp| awk '{print $1/1000}'` "°C" + echo -e "\033[1;33m CPU-Temp: \033[0m" `cat /sys/class/thermal/thermal_zone0/temp| awk '{print $1/1000}'` "°C" fi echo -e "\033[1;33m IPs: \033[0m" `ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1` echo -e "\033[1;33m Macs: \033[0m" `ip link | grep ether` diff --git a/mobilfetch_en.sh b/mobilfetch_en.sh index e779371..517a279 100755 --- a/mobilfetch_en.sh +++ b/mobilfetch_en.sh @@ -37,7 +37,7 @@ echo -e "\033[1;33m System time: \033[0m" `date | awk '{print $4}'` echo -e "\033[1;33m Online time: \033[0m" `uptime | awk '{print $3}'` "Stunden" echo -e "\033[1;33m Memory Usage: \033[0m" `cat /proc/meminfo|grep 'MemF'| awk '{print $2}'` "kB von" `cat /proc/meminfo|grep 'MemT'| awk '{print $2}'` "kB frei" if [ -f /sys/class/thermal/thermal_zone0/temp ]; then -echo -e "\033[1;33m CPU-Temp: \033[0m" `cat /sys/class/thermal/thermal_zone0/temp| awk '{print $1/1000}'` "°C" + echo -e "\033[1;33m CPU-Temp: \033[0m" `cat /sys/class/thermal/thermal_zone0/temp| awk '{print $1/1000}'` "°C" fi echo -e "\033[1;33m IPs: \033[0m" `ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1` echo -e "\033[1;33m Macs: \033[0m" `ip link | grep ether`