⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config_scripts.sh

📁 Linux嵌入式设计配套光盘,学习嵌入式设计可参考
💻 SH
字号:
#!/bin/shheader="#!/usr/local/bin/php"files="setup_network.php setup_snmp.php setup_alarm.php status.php reports_logs.php help_howto.php help_whatif.php help_contact_us.php phpinfo.php wait_for_status.php howto/Add_new_help_topics.php howto/Install_additional_sensors.php whatif/An_alarm_is_not_detected.php whatif/A_zone_stays_in_alarm.php"basename=`basename $0`# shouldn't need to modify below this line if [ $# -lt 1 ]; then    echo "Usage: $basename php"   echo "Usage: $basename cgi <php path>"   exit 1fiscript_type=$1# script_type is either php or cgiif [ "$script_type" != "php" -a "$script_type" != "cgi" ]; then   echo "Usage: $basename php"   echo "Usage: $basename cgi <php path>"   exit 1fifor file in $files; do     if [ ! -f $file ]; then       echo "File $file does not exist, exiting..."       exit 1    fi    # output of following grep will be like "2:<?php 120:<?php"    # pick out the number before the first ':' char    num=`grep -n '<?php' $file | sed 's/\([^:]\):.*/\1/g'`    # create a temporary file    tmp_file=`mktemp /tmp/XXXXXX`     if [ $? -ne 0 ]; then        echo "$basename: Unable to make temp file, exiting..."        exit 1    fi    # write header to this file    msg="Removing header from $file."    if [ "$script_type" = "cgi" ]; then        echo $header > $tmp_file        msg="Adding header $header to $file."    fi    # append to thie file tail +$num     tail +$num $file >> $tmp_file    diff $file $tmp_file > /dev/null    if [ $? -ne 0 ]; then        echo "$0: $msg"        mv $tmp_file $file        chmod a+x $file    fidone

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -