Tag: 脚本
慎用第三方一键翻墙脚本
星期天早上上周星期天起床后,看到手机上收到一封来自virmach的邮件:Service Suspension Notification。VIRMACH上年付只用了3个月的VPS被封了,Suspension Reason: PSN HijackingVPS只用于翻墙,只装了2个第三方一键脚本,一个是t ...
Shell脚本实现网站静态化
思路简单清晰,使用curl或wget抓取页面生成静态页面,方法来自http://zhangge.net/5095.htmlDEMO:静态化sitemap.html wget http://seonoco.com/index.php/sitemap.html -O /www/seonoco.com/s ...
crontab执行脚本中文乱码,手动执行正常
新装的一台服务器上crontab执行后中文显示乱码,但是手动执行结果却显示正常。GOOGLE之,测试有效的解决办法:#!/bin/sh### crontab执行脚本中文乱码,手动执行正常export LANG=en_US.UTF-8 ...
shell脚本报错:"[: =: unary operator expected"
报错DEMO: [root@localhost ~]# cat test.sh#!/bin/bashif [ $1 = 'noco' ] ; then echo 'yes'else echo 'no'fi[root@localhost ~]# ./test.sh./test.sh: li ...
shell脚本判断Linux是32位还是64位
下面的shell脚本函数引用自 lnmp1.2-full/include/main.shGet_OS_Bit(){ if [[ `getconf WORD_BIT` = '32' && `getconf LONG_BIT` = '64' ]] ; then Is_ ...
shell脚本if表达式
无论什么编程语言都离不开条件判断。SHELL也不例外。大体的格式如下:if list thendo something hereelif list thendo another thing hereelsedo something else herefi 一个例子:#!/bin/shSYSTEM=` ...