From 7f6147871c3f302559fe6ad315eec162253ed839 Mon Sep 17 00:00:00 2001 From: isaac <iehl1g23@soton.ac.uk> Date: Fri, 20 Dec 2024 00:26:34 +0800 Subject: [PATCH] removed -p from scripts aswell --- bnb_graph.sh | 3 +-- btc_graph.sh | 3 +-- collect_data.sh | 3 +-- doge_graph.sh | 3 +-- eth_graph.sh | 3 +-- sol_graph.sh | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bnb_graph.sh b/bnb_graph.sh index 7dbc1e8..1931c4f 100755 --- a/bnb_graph.sh +++ b/bnb_graph.sh @@ -2,14 +2,13 @@ # Database credentials DB_USER="root" -DB_PASS="" DB_NAME="crypto_tracker" # Temporary file for storing the data temp_file="bnb_temp_data.txt" # Fetch data for the last 24 hours -mysql -u "$DB_USER" -p"$DB_PASS" -D "$DB_NAME" -e \ +mysql -u "$DB_USER" -D "$DB_NAME" -e \ "SELECT UNIX_TIMESTAMP(timestamp), price FROM bnb_prices WHERE timestamp >= NOW() - INTERVAL 24 HOUR ORDER BY timestamp ASC" > "$temp_file" # Format the data for gnuplot diff --git a/btc_graph.sh b/btc_graph.sh index b1ac439..7daf2a4 100755 --- a/btc_graph.sh +++ b/btc_graph.sh @@ -2,14 +2,13 @@ # Database credentials DB_USER="root" -DB_PASS="" DB_NAME="crypto_tracker" # Temporary file for storing the data temp_file="temp_data.txt" # Fetch data for the last 24 hours -mysql -u "$DB_USER" -p"$DB_PASS" -D "$DB_NAME" -e \ +mysql -u "$DB_USER" -D "$DB_NAME" -e \ "SELECT UNIX_TIMESTAMP(timestamp), price FROM btc_prices WHERE timestamp >= NOW() - INTERVAL 24 HOUR ORDER BY timestamp ASC" > "$temp_file" # Format the data for gnuplot (remove the first line containing column names) diff --git a/collect_data.sh b/collect_data.sh index 299cefc..0a517cb 100755 --- a/collect_data.sh +++ b/collect_data.sh @@ -84,11 +84,10 @@ echo "Dogecoin: Price=$dogeprice, High=$dogehigh, Low=$dogelow" # Database credentials DB_USER="root" -DB_PASS="" DB_NAME="crypto_tracker" # Insert data into the database -mysql -u $DB_USER -p$DB_PASS $DB_NAME <<EOF +mysql -u $DB_USER $DB_NAME <<EOF INSERT INTO btc_prices (price, high, low) VALUES ($btcprice, $btchigh, $btclow); INSERT INTO eth_prices (price, high, low) VALUES ($ethprice, $ethhigh, $ethlow); INSERT INTO sol_prices (price, high, low) VALUES ($solprice, $solhigh, $sollow); diff --git a/doge_graph.sh b/doge_graph.sh index 163852b..fe8073a 100755 --- a/doge_graph.sh +++ b/doge_graph.sh @@ -2,14 +2,13 @@ # Database credentials DB_USER="root" -DB_PASS="" DB_NAME="crypto_tracker" # Temporary file for storing the data temp_file="doge_temp_data.txt" # Fetch data for the last 24 hours -mysql -u "$DB_USER" -p"$DB_PASS" -D "$DB_NAME" -e \ +mysql -u "$DB_USER" -D "$DB_NAME" -e \ "SELECT UNIX_TIMESTAMP(timestamp), price FROM doge_prices WHERE timestamp >= NOW() - INTERVAL 24 HOUR ORDER BY timestamp ASC" > "$temp_file" # Format the data for gnuplot diff --git a/eth_graph.sh b/eth_graph.sh index 55a56e2..d9893a4 100755 --- a/eth_graph.sh +++ b/eth_graph.sh @@ -2,14 +2,13 @@ # Database credentials DB_USER="root" -DB_PASS="" DB_NAME="crypto_tracker" # Temporary file for storing the data temp_file="eth_temp_data.txt" # Fetch data for the last 24 hours -mysql -u "$DB_USER" -p"$DB_PASS" -D "$DB_NAME" -e \ +mysql -u "$DB_USER" -D "$DB_NAME" -e \ "SELECT UNIX_TIMESTAMP(timestamp), price FROM eth_prices WHERE timestamp >= NOW() - INTERVAL 24 HOUR ORDER BY timestamp ASC" > "$temp_file" # Format the data for gnuplot (remove the first line containing column names) diff --git a/sol_graph.sh b/sol_graph.sh index f70ad66..fc9a23d 100755 --- a/sol_graph.sh +++ b/sol_graph.sh @@ -2,14 +2,13 @@ # Database credentials DB_USER="root" -DB_PASS="" DB_NAME="crypto_tracker" # Temporary file for storing the data temp_file="sol_temp_data.txt" # Fetch data for the last 24 hours -mysql -u "$DB_USER" -p"$DB_PASS" -D "$DB_NAME" -e \ +mysql -u "$DB_USER" -D "$DB_NAME" -e \ "SELECT UNIX_TIMESTAMP(timestamp), price FROM sol_prices WHERE timestamp >= NOW() - INTERVAL 24 HOUR ORDER BY timestamp ASC" > "$temp_file" # Format the data for gnuplot -- GitLab