Loading... #### 使用前提是需要可用的YUM源! ``` #!/bin/sh #状态查看 if [ "$1" == "status" ]; then vncserver -list; #安装 elif [ "$1" == "install" ]; then yum install vnc-server; #启动(默认启在5901端口) elif [ "$1" == "start" ]; then vncserver :1; vncserver -list; #停止 elif [ "$1" == "stop" ]; then vncserver -kill :1; vncserver -list; #重启 elif [ "$1" == "restart" ]; then vncserver -kill :1; vncserver :1; vncserver -list; #改密并启动 elif [ "$1" == "passwd" ]; then vncserver -kill :1; rm -f ~/.vnc/passwd; vncserver :1; vncserver -list; #卸载 elif [ "$1" == "uninstall" ]; then vncserver -kill :1; yum remove vnc-server; rm -ir ~/.vnc; else echo "invalid argument! [install/start/stop/restart/status/passwd/uninstall]"; fi ``` 最后修改:2021 年 11 月 02 日 05 : 21 PM © 允许规范转载 赞赏 要多恰饭才能长胖 赞赏作者 支付宝微信