I have what I think is a very useful script here if you use NetBeans on VirtualBox guest. There seems to be one problem:
如果你看看这封信件,就会把网上贝曼项目从东道国系统排到客座。 罚款。 然而,另外还制作了一个文字,并将其转移到当地用户的双版上。 事实上,有两种文字: (1) 允许用户站立起来,2) 放弃安装的夹,以允许灵活性。
我测试了我的乌班特客的文字和一切作品,但网本是一纸。
它将不 un在boot子上安装的轨迹,而我已尝试让文字材料扎根。
Any clues as to if this will work and how? :
#!/bin/bash
#Author: Yucca Nel http://thejarbar.org
#Will restart system
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
#Modify these variables as needed...
tempWork=/tmp/work
startupScript=/etc/init.d/rc.local
defaultNetBeansVersion=7.0.1
echo "Provide NetBeans version (7.0.1 is default) then hit [Enter] :"
read NetBeansVersion
if [ -z "$NetBeansVersion" ]
then
$NetBeansVersion=$defaultNetBeansVersion
fi
mkdir -p /$tempWork;
cd /$tempWork;
wget http://dlc.sun.com.edgesuite.net/netbeans/7.0.1/final/bundles/netbeans-$NetBeansVersion-ml-javase-linux.sh;
sh $tempWork/*sh;
#Add Netbeans launcher to your PATH. Doing so allows you to run netbeans command from the terminal
#This line will need to be changed if you changed the default install location (IOW Netbeans is not in ~/)
sudo ln -f -s ~/netbeans-$NetBeansVersion/bin/netbeans /usr/bin/;
#If you use VirtualBox , you can share your projects between Host and guest. Name of shared
#folder must match NetBeansProjects
mkdir -p $HOME/NetBeansProjects
if [ -f /sbin/mount.vboxsf ]
then
sudo /sbin/umount /home/$HOME/NetBeansProjects
sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects
fi
if mountpoint -q ~/NetBeansProjects
then
#Add it to the universal start script to automate process...
sudo sed -ie $d $startupScript
echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects"| sudo tee -a $startupScript
echo "exit 0"| sudo tee -a $startupScript
sudo chmod +x $startupScript
#Create a mount and unmount script file and add it to users local bin
rm -rf $tempWork/*
echo #!/bin/bash > $tempWork/netbeans-mount.sh
echo #!/bin/bash > $tempWork/netbeans-umount.sh
echo #!/bin/bash > $tempWork/mount-from-host.sh
echo #!/bin/bash > $tempWork/unmount-from-host.sh
echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" >> $tempWork/netbeans-mount.sh
echo "sudo /sbin/mount.vboxsf NetBeansProjects $HOME/NetBeansProjects" >> $tempWork/mount-from-host.sh
echo "sudo umount $HOME/NetBeansProjects" >> $tempWork/netbeans-umount.sh
echo "sudo umount $HOME/NetBeansProjects" >> $tempWork/unmount-from-host.sh
echo "exit 0" >> $tempWork/unmount-from-host.sh
echo "exit 0" >> $tempWork/mount-from-host.sh
echo "exit 0" >> $tempWork/netbeans-mount.sh
echo "exit 0" >> $tempWork/netbeans-umount.sh
sudo chmod +x $tempWork/*
sudo mv -f $tempWork/*.sh /usr/local/bin
rm -rf $tempWork
fi
#This function is used to cleanly exit with an error code.
function error_exit {
sleep 7
exit 1
}
#restart
sudo reboot
exit 0
Update: Hand coded unmounting in terminal also fails to unmount the NetBeans Projects folder. So I guess I need to ask if it s even possible to unmount this folder if the system initialization mounted the folder?
Update2:Still Stuck, but I have some new info after looking in etc/mtab
.
Here is what I see:
...
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
NetBeansProjects /home/yucca/NetBeansProjects vboxsf rw 0 0
...
很显然,我不得不多次起诉“~”项目!
Additional mount options like f-l-a-t won t work either as it unmounts everything and I only want my targeted directory unmounted.