debian下挂vagex一键包代码

debian下挂vagex一键包代码

admin
2012-09-29 / 0 评论 / 185 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2018年06月25日,已超过2133天没有更新,若内容或图片失效,请留言反馈。
debian下一键安装挂vagex环境 在host1free 128 下测试通过 debian6 32bit 
先用vi 建立下面的内容 比如保存为vg.sh,就用vi vg.sh,保存后 再chmod +x vg.sh , ./vg.sh 回车 就行了 
安装完后 用vnc连接IP:1 去设置你的vagex ID 开挂成功 ,重启一下就全自动运行了,  这里没有增加定期删日志和重启 ,大家可参见centos的cron

#!/bin/sh
apt-get -y remove portmap* httpd* bind9* samba* nscd* sendmail* apache*
apt-get update
apt-get -y install vnc4server iceweasel expect
wget http://fpdownload.adobe.com/get/flashplayer/pdc/10.3.183.19/install_flash_player_10_linux.tar.gz
tar xvzf install_flash_player_10_linux.tar.gz
mkdir -p ~/.mozilla/plugins/
mv libflashplayer.so ~/.mozilla/plugins/
rm -rf usr
rm -rf install_flash_player_10_linux.tar.gz
touch /etc/init.d/vncserver
cat > /etc/init.d/vncserver<<EOF
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: \$remote_fs \$syslog
# Required-Stop: \$remote_fs \$syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
PATH="\$PATH:/usr/X11R6/bin/"z
# The Username:Group that will run VNC
export USER="root"
#\${RUNAS}
# The display that VNC will use
DISPLAY="1"
# Color depth (between 8 and 32)
DEPTH="16"
# The Desktop geometry to use
#GEOMETRY="x"
GEOMETRY="800x600"
#You Can Choice GEOMETRY="1024x768" && GEOMETRY="1280x1024"
# The name that the VNC Desktop will have.
NAME="Vncserver"
OPTIONS="-name \${NAME} -depth \${DEPTH} -geometry \${GEOMETRY} :\${DISPLAY}"
. /lib/lsb/init-functions
case "\$1" in
start)
su \${USER} -c "/usr/bin/vncserver \${OPTIONS}"
;;
stop)
su \${USER} -c "/usr/bin/vncserver -kill :\${DISPLAY}"
;;
restart)
\$0 stop
\$0 start
;;
esac
exit 0
EOF
chmod +x /etc/init.d/vncserver
update-rc.d vncserver defaults
touch ~/vnc.sh
cat > ~/vnc.sh<<EOF
#!/usr/bin/expect
# Change VNC password
set timeout 30
spawn vncpasswd
expect "Password:"
send "1234567\r"
expect "Verify:"
send "1234567\r"
expect eof
exit
EOF
chmod +x ~/vnc.sh
~/vnc.sh
vncserver :1
cat > ~/.vnc/xstartup<<EOF
#!/bin/sh
iceweasel --display=:1
EOF
touch ~/addon.sh
cat >~/addon.sh<<EOF
iceweasel https://addons.mozilla.org/firefox/downloads/file/147370/vagex_firefox_add_on-1.2.2-fx.xpi --display=:1
EOF
chmod +x ~/addon.sh
/root/addon.sh &
#rm -rf ~/vnc.sh
#rm -rf ~/addon.sh
echo "VNC password is \"1234567\""
echo "You can change it use \"vncpasswd\""
echo "kinsw.com by hollandmoon  qdmz.tk update"
0

评论

博主关闭了当前页面的评论