You are not logged in.
Good Day/Night
I've created an install script but for some reason the partitioning function returns an error though it was successfull. Sorry if this isn't the right place, but I thought its to do with installation so seemed logical I post here. I've done some heavy googling but have not managed to find the answer, maybe I am googling the wrong thing.
Anyway, my part of the script is as such:
ffdisk=$(cat<<EOF
n
p
1
+350M
n
p
2
a
1
p
w
EOF
)
partion_drive()
{
echo Partitioning Drive
fdisk -l
read -p "Please enter drive: " drive
fdisk $drive <<< "$ffdisk"
if [ $? -ne 0 ]; then
read -p "Failed to partition: $?\nDo you want to continue [y/n]?" cont
if [[$cont == "y" || $cont == "Y"]]; then
return 0
fi
return 1
fi
return 0
}
read -p "Full install [y\n]? " full
if [[ $full == "Y" || $full == "y" ]]; then
if [["$(partion_drive)" == "0" ]]; then
...
else
echo Could not partition drive: $?
fi
fi
when it runs, it does partition the drive and ends with the following:
Calling ioctl() to re-read partition table.
Syncing disks.: No such file or directory
Could not partition drive: 127
If anyone could shed any light on this I would be much appreciated
Cheers
Last edited by eiboon (2017-03-01 21:27:54)
Offline
Moving to Programming and Scripting...
Offline
Sorted it, return isnt a command. the 127 error code is related to not being able to find a command.
Offline