#!/usr/bin/env bash # set -ex if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 sudo "${0}" "$@" exit 0 fi sfdisk -l read -p "Welches Laufwerk soll beschrieben werden?: [/dev/sda|/dev/sdb] " device [[ -z "${device}" ]] && echo "No device is set! Abort..." && exit 1 echo "Wipe Device ${device} ..." sleep 5 wipefs -a -f ${device} echo "Create new Partition type ..." sleep 5 bootpartitionnummer=1 rootpartitionnummer=2 fdisk ${device} <