Skip to content
Snippets Groups Projects
Verified Commit 0334d21e authored by Christoph Johannes Kleine's avatar Christoph Johannes Kleine
Browse files

diskspreparation.sh: korrigiere bash Fehler

Fehler "to many arguments" gelöst durch Anführungszeichen
parent a315b88f
Branches
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ convertSizeToByte() { ...@@ -22,7 +22,7 @@ convertSizeToByte() {
local unit=$(echo $1 | sed "s/[0-9\.]*//g") local unit=$(echo $1 | sed "s/[0-9\.]*//g")
local value=$(echo $1 | sed "s/[a-zA-Z%]*//g") local value=$(echo $1 | sed "s/[a-zA-Z%]*//g")
local factor=1 local factor=1
case $(echo ${unit} | tr [A-Z] [a-z]) in case $(echo ${unit} | tr [A-Z] [a-z]) in
"b") factor=1 ;; "b") factor=1 ;;
"kb") factor=1000 ;; "kb") factor=1000 ;;
...@@ -37,7 +37,7 @@ convertSizeToByte() { ...@@ -37,7 +37,7 @@ convertSizeToByte() {
esac esac
res=$(dc -e "0k ${value} ${factor} * p") res=$(dc -e "0k ${value} ${factor} * p")
echo "${res%.*}" echo "${res%.*}"
} }
...@@ -77,7 +77,7 @@ validateScheme() { ...@@ -77,7 +77,7 @@ validateScheme() {
local lbl=$(echo ${diskdata[0]} | cut -f 6 -d ":") local lbl=$(echo ${diskdata[0]} | cut -f 6 -d ":")
local retval=1 local retval=1
local scheme=$(eval echo \$DISK_$(echo $1 | tr [a-z] [A-Z])_SCHEME) local scheme=$(eval echo \$DISK_$(echo $1 | tr [a-z] [A-Z])_SCHEME)
if [ "x${scheme}" = "x${lbl}" ]; if [ "x${scheme}" = "x${lbl}" ];
then then
retval=0 retval=0
...@@ -180,7 +180,7 @@ initialDiskPartitionLayout() { ...@@ -180,7 +180,7 @@ initialDiskPartitionLayout() {
done done
} }
# setDiskPartitionFlags - set the flags of a disk partitions # setDiskPartitionFlags - set the flags of a disk partition
# parameter: # parameter:
# $1 - disk device name # $1 - disk device name
# return: # return:
...@@ -276,7 +276,7 @@ formatDiskPartitions() { ...@@ -276,7 +276,7 @@ formatDiskPartitions() {
done done
} }
# generateFSTab - generate an fstab file # generateFSTab - generate fstab file
# parameter: # parameter:
# $1 - path of fstab file # $1 - path of fstab file
# $2 - mount path prefix (optional) # $2 - mount path prefix (optional)
...@@ -313,12 +313,12 @@ generateFSTab() { ...@@ -313,12 +313,12 @@ generateFSTab() {
dmp=$(echo ${part} | cut -f 5 -d ":") dmp=$(echo ${part} | cut -f 5 -d ":")
pass=$(echo ${part} | cut -f 6 -d ":") pass=$(echo ${part} | cut -f 6 -d ":")
if [ ${fs} = "swap" -o ${fs} = "linux-swap" ]; if [ "${fs}" = "swap" -o "${fs}" = "linux-swap" ];
then then
mntpnt="none" mntpnt="none"
fi fi
if [ -n ${fs} -a -n ${mntpnt} -a -n ${uuid} ]; if [ -n "${fs}" -a -n "${mntpnt}" -a -n "${uuid}" ];
then then
echo "#/dev/${disk}${idx}" >>$1 echo "#/dev/${disk}${idx}" >>$1
if [ ${mntpnt} != "none" ]; if [ ${mntpnt} != "none" ];
...@@ -343,7 +343,7 @@ do ...@@ -343,7 +343,7 @@ do
done done
validateScheme ${disk} validateScheme ${disk}
if [ $? -eq 0 ]; if [ $? -eq 0 ];
then then
validateDiskPartitionLayout ${disk} validateDiskPartitionLayout ${disk}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment