You are not logged in.

#1 2017-03-01 18:19:38

eiboon
Member
Registered: 2016-04-28
Posts: 14

Help with install script needed [solved]

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 smile

Last edited by eiboon (2017-03-01 21:27:54)

Offline

#2 2017-03-01 18:38:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Help with install script needed [solved]

Moving to Programming and Scripting...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-03-01 21:26:52

eiboon
Member
Registered: 2016-04-28
Posts: 14

Re: Help with install script needed [solved]

Sorted it, return isnt a command.  the 127 error code is related to not being able to find a command.

Offline

Board footer

Powered by FluxBB