I have been working on this script for quite some time.But I have been getting errors.The script is supposed to use tmpfs to quickly transfer files from point A to point B.
The script is shown below.
#!/bin/bash
cat .ramv &> /dev/null
if [[ $? = "1" ]]; then
dialog --yesno "I have detected that you have not used this program before.Would you like to setup the ramdisk and install the needed packages?" 24 80
else
if [[ $? = "0" ]]; then
tail --lines=+27 ~/ramv.sh | bash
fi
fi
if [[ $? = "1" ]]; then
dialog --msgbox "This command will not work if you dont install the packages and the ramdisk." 24 80
else
if
dialog --yesno "The ramdisk size defaults to 2GB.Do you have more than 4GB of RAM in total?" 24 80
if [[ $? = "1" ]]; then
dialog --msgbox "This command will not work if you do not have more than 4GB of RAM" 24 80
else
dialog --msgbox "I need root accsess for this to work.Could you please enter your root password?" 24 80
sudo dialog --msgbox "Thanks! We can now commence with creating the ramdisk" 24 80
sudo mkdir /mnt/tmp
sudo mount -t tmpfs -o size=2g tmpfs /mnt/tmp
sudo echo "
tmpfs /mnt/tmp tmpfs rw,size=2G 0 0" >> /etc/fstab
dialog --msgbox "The setup has commpleted. A help file has been writen to your home folder." 24 80
touch .ramv
fi
mv $1 /mnt/tmp
mv /mnt/tmp/$1 $2
The error is shown below
eli@eli-desktop:~$ ./ramv.sh
./ramv.sh: line 29: syntax error: unexpected end of file
eli@eli-desktop:~$
Can someone show me why this error is happening and how to fix it?