Skip to content

Commit

Permalink
use conf as pwdconf and dbconf
Browse files Browse the repository at this point in the history
  • Loading branch information
catscarlet committed Aug 17, 2015
1 parent 9f9d751 commit 15a1a79
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@
0:41 2015/8/17
更新图标显示,由IP变换为别名

11:54 2015/8/17
更新shell配置


6 changes: 3 additions & 3 deletions Public/shell/goping.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
needforping_DIR=/var/www/html/8091/needforpingthinksmarty/Public/
#!/bin/bash
. needforping.conf

TMP_DIR=/$needforping_DIR/shell/pingresult
SERVER_LIST=/$needforping_DIR/shell/server_list.txt
Expand All @@ -13,6 +13,6 @@ OUTPUTFORJS=$TMP_DIR/$line.json
echo $THESERVER >> $OUTPUTTXT
DATETIME="Pingtime is "`date "+%Y-%m-%d %H:%M:%S"`" CST"
echo $DATETIME >> $OUTPUTTXT
ping -c 100 $line |tail -n 3 >> $OUTPUTTXT
ping -c 4 $line |tail -n 3 >> $OUTPUTTXT

$needforping_DIR/shell/readline.sh $OUTPUTTXT $OUTPUTTMP
7 changes: 7 additions & 0 deletions Public/shell/needforping.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
needforping_DIR=/var/www/html/8091/needforpingthinksmarty/Public/

DB_NAME=needforping
DB_USER=thinkphp
DB_PWD=PEy4cmbnenKWP4db
DB_PREFIX=think_
4 changes: 2 additions & 2 deletions Public/shell/needforping.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#!/bin/bash

needforping_DIR=/var/www/html/8091/needforpingthinksmarty/Public/
. needforping.conf

TMP_DIR=/$needforping_DIR/shell/pingresult
SERVER_LIST=/$needforping_DIR/shell/server_list.txt
Expand Down
10 changes: 2 additions & 8 deletions Public/shell/readline.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/bash
. needforping.conf

i=0
OUTPUT=$2


DB_NAME=needforping
DB_USER=thinkphp
DB_PWD=PEy4cmbnenKWP4db
DB_PREFIX=think_



function output_to_mysql() {
MYSQL_COMMAND="INSERT INTO $DB_PREFIX$DB_NAME.pingresult (id, server_name, DATETIME, loss_percent, rtt_min, rtt_avg, rtt_max) VALUES (NULL, \"$THESERVER\", \"$DATETIME\", \"$LOSS\", \"$min\", \"$avg\", \"$max\");"
mysql -u$DB_USER -p$DB_PWD -e "$MYSQL_COMMAND"
Expand Down

0 comments on commit 15a1a79

Please sign in to comment.