From a6b3467749b3bbe6c2493d3d8311be0c45dbe7d2 Mon Sep 17 00:00:00 2001 From: George Milescu Date: Fri, 6 Aug 2010 18:30:00 +0200 Subject: [PATCH] Updated all source globalconfig with file-check operation Signed-off-by: George Milescu --- ControlScripts/clients/hrk/start_hrk_leecher.sh | 9 +++++++-- ControlScripts/clients/hrk/start_hrk_seeder.sh | 9 +++++++-- ControlScripts/clients/tribler/start_tribler_doe.sh | 9 +++++++-- ControlScripts/clients/tribler/start_tribler_gui.sh | 9 +++++++-- ControlScripts/clients/tribler/start_tribler_leecher.sh | 9 +++++++-- ControlScripts/clients/tribler/start_tribler_proxy.sh | 9 +++++++-- ControlScripts/clients/tribler/start_tribler_seeder.sh | 9 +++++++-- ControlScripts/detect_complete_client.sh | 9 +++++++-- ControlScripts/parse_client_log.sh | 9 +++++++-- ControlScripts/run_campaign.sh | 9 +++++++-- ControlScripts/run_scenario.sh | 9 +++++++-- ControlScripts/schedule_client.sh | 9 +++++++-- ControlScripts/start_tracker.sh | 9 +++++++-- ControlScripts/stop_client.sh | 9 +++++++-- Utils/grep_search.sh | 9 +++++++-- Utils/show_version.sh | 9 +++++++-- Utils/sync_cluster.sh | 9 +++++++-- Utils/sync_cluster_containers.sh | 9 +++++++-- Utils/sync_kth.sh | 9 +++++++-- Utils/sync_single_cluster_container.sh | 9 +++++++-- Utils/sync_single_cluster_container_scripts.sh | 9 +++++++-- Utils/sync_swarm.cs.pub.ro.sh | 9 +++++++-- Utils/sync_vm.sh | 9 +++++++-- 23 files changed, 161 insertions(+), 46 deletions(-) diff --git a/ControlScripts/clients/hrk/start_hrk_leecher.sh b/ControlScripts/clients/hrk/start_hrk_leecher.sh index 221bad0..a891afb 100755 --- a/ControlScripts/clients/hrk/start_hrk_leecher.sh +++ b/ControlScripts/clients/hrk/start_hrk_leecher.sh @@ -9,8 +9,13 @@ # libtorrent-rasterbar location # * at the end deletes the downloaded data -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file (TORRENT_FILE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/clients/hrk/start_hrk_seeder.sh b/ControlScripts/clients/hrk/start_hrk_seeder.sh index 5e1e3b9..f36e0a2 100755 --- a/ControlScripts/clients/hrk/start_hrk_seeder.sh +++ b/ControlScripts/clients/hrk/start_hrk_seeder.sh @@ -9,8 +9,13 @@ # libtorrent-rasterbar location # * at the end deletes the downloaded data -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file (TORRENT_FILE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/clients/tribler/start_tribler_doe.sh b/ControlScripts/clients/tribler/start_tribler_doe.sh index bcb3711..51ab1d5 100755 --- a/ControlScripts/clients/tribler/start_tribler_doe.sh +++ b/ControlScripts/clients/tribler/start_tribler_doe.sh @@ -8,8 +8,13 @@ # * starts a tribler cmd-line instance with the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder # * at the end deletes the downloaded data -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file (TORRENT_FILE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/clients/tribler/start_tribler_gui.sh b/ControlScripts/clients/tribler/start_tribler_gui.sh index d2b1b6f..eb06688 100755 --- a/ControlScripts/clients/tribler/start_tribler_gui.sh +++ b/ControlScripts/clients/tribler/start_tribler_gui.sh @@ -7,8 +7,13 @@ # * changes current working directory to proxymode # * starts a GUI tribler instance -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/clients/tribler/start_tribler_leecher.sh b/ControlScripts/clients/tribler/start_tribler_leecher.sh index 3581e53..c0cee87 100755 --- a/ControlScripts/clients/tribler/start_tribler_leecher.sh +++ b/ControlScripts/clients/tribler/start_tribler_leecher.sh @@ -8,8 +8,13 @@ # * starts a tribler cmd-line instance with the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder # * at the end deletes the downloaded data -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file (TORRENT_FILE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/clients/tribler/start_tribler_proxy.sh b/ControlScripts/clients/tribler/start_tribler_proxy.sh index af475d4..301510e 100755 --- a/ControlScripts/clients/tribler/start_tribler_proxy.sh +++ b/ControlScripts/clients/tribler/start_tribler_proxy.sh @@ -16,8 +16,13 @@ if [ ! $# -eq 1 ]; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/clients/tribler/start_tribler_seeder.sh b/ControlScripts/clients/tribler/start_tribler_seeder.sh index c885f13..b8e5f3f 100755 --- a/ControlScripts/clients/tribler/start_tribler_seeder.sh +++ b/ControlScripts/clients/tribler/start_tribler_seeder.sh @@ -7,8 +7,13 @@ # * changes current working directory to proxyservice-m32 # * starts a command line BT client seeding the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../../../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../../../ConfigFiles/globalconfig does not exist." +else + source ../../../ConfigFiles/globalconfig +fi # Read scenarion configuration file (TORRENT_FILE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/detect_complete_client.sh b/ControlScripts/detect_complete_client.sh index 64ce19f..294200b 100755 --- a/ControlScripts/detect_complete_client.sh +++ b/ControlScripts/detect_complete_client.sh @@ -16,8 +16,13 @@ if test $# -ne 1; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read scenarion configuration file (CLIENT_TYPE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/parse_client_log.sh b/ControlScripts/parse_client_log.sh index dbad40e..228b2ce 100755 --- a/ControlScripts/parse_client_log.sh +++ b/ControlScripts/parse_client_log.sh @@ -16,8 +16,13 @@ if test $# -ne 3; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read client mappings configuration file source ../ConfigFiles/client_script_mappings diff --git a/ControlScripts/run_campaign.sh b/ControlScripts/run_campaign.sh index 5fa25e6..676e9ed 100755 --- a/ControlScripts/run_campaign.sh +++ b/ControlScripts/run_campaign.sh @@ -17,8 +17,13 @@ if [ ! $# -eq 1 ]; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read arguments CAMPAIGN_FILE=$1 diff --git a/ControlScripts/run_scenario.sh b/ControlScripts/run_scenario.sh index ba18cd3..6bbb014 100755 --- a/ControlScripts/run_scenario.sh +++ b/ControlScripts/run_scenario.sh @@ -37,8 +37,13 @@ if [ ! $# -eq 3 ]; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read arguments ACTION=$1 diff --git a/ControlScripts/schedule_client.sh b/ControlScripts/schedule_client.sh index ac23869..59ac82a 100755 --- a/ControlScripts/schedule_client.sh +++ b/ControlScripts/schedule_client.sh @@ -10,8 +10,13 @@ # use _DEBUG="off" to turn off debug printing _DEBUG="on" -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read scenarion configuration file source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/start_tracker.sh b/ControlScripts/start_tracker.sh index 65dc392..2f2173a 100755 --- a/ControlScripts/start_tracker.sh +++ b/ControlScripts/start_tracker.sh @@ -7,8 +7,13 @@ # * changes current working directory to BitTornado-CVS # * starts a tracker listening on port 6969 -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read scenarion configuration file source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/ControlScripts/stop_client.sh b/ControlScripts/stop_client.sh index 733aeb8..eab657e 100755 --- a/ControlScripts/stop_client.sh +++ b/ControlScripts/stop_client.sh @@ -10,8 +10,13 @@ # use _DEBUG="off" to turn off debug printing _DEBUG="on" -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi # Read scenarion configuration file (CLIENT_TYPE) source ../ClientWorkingFolders/TmpLogs/scenario_config diff --git a/Utils/grep_search.sh b/Utils/grep_search.sh index fb497ef..333bc71 100755 --- a/Utils/grep_search.sh +++ b/Utils/grep_search.sh @@ -11,8 +11,13 @@ # ./grep_search.sh "text" -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi cd $TRIBLER_REL_PATH diff --git a/Utils/show_version.sh b/Utils/show_version.sh index cbb8eac..2769d05 100755 --- a/Utils/show_version.sh +++ b/Utils/show_version.sh @@ -7,8 +7,13 @@ # * changes current working directory to proxyservice-m32 # * starts a tribler cmd-line instance to display the current version -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi export PYTHONPATH=$PYTHONPATH:. diff --git a/Utils/sync_cluster.sh b/Utils/sync_cluster.sh index dca8da3..3e67e7d 100755 --- a/Utils/sync_cluster.sh +++ b/Utils/sync_cluster.sh @@ -3,8 +3,13 @@ # Copyright: George Milescu 2010 - george.milescu@gmail.com # -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-01.grid.pub.ro:/home/p2p/george/P2P-Next rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-03.grid.pub.ro:/home/p2p/george/P2P-Next diff --git a/Utils/sync_cluster_containers.sh b/Utils/sync_cluster_containers.sh index f24d787..ecda9d9 100755 --- a/Utils/sync_cluster_containers.sh +++ b/Utils/sync_cluster_containers.sh @@ -3,8 +3,13 @@ # Copyright: George Milescu 2010 - george.milescu@gmail.com # -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi for host in p2p-next-01.grid.pub.ro p2p-next-03.grid.pub.ro p2p-next-04.grid.pub.ro p2p-next-05.grid.pub.ro p2p-next-06.grid.pub.ro p2p-next-07.grid.pub.ro p2p-next-08.grid.pub.ro p2p-next-09.grid.pub.ro p2p-next-10.grid.pub.ro; do for port in 10122 10222 10322 10422 10522 10622 10722 10822 10922 11022; do diff --git a/Utils/sync_kth.sh b/Utils/sync_kth.sh index 520883d..eb34a3b 100755 --- a/Utils/sync_kth.sh +++ b/Utils/sync_kth.sh @@ -3,7 +3,12 @@ # Copyright: George Milescu 2010 - george.milescu@gmail.com # -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi rsync -avP --del $P2P_NEXT_REL_PATH george@p2p-next.xen.ssvl.kth.se:/home/george/P2P-Next diff --git a/Utils/sync_single_cluster_container.sh b/Utils/sync_single_cluster_container.sh index 3d9ba40..6197d72 100755 --- a/Utils/sync_single_cluster_container.sh +++ b/Utils/sync_single_cluster_container.sh @@ -8,8 +8,13 @@ if test $# -ne 2; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi host=$1 port=$2 diff --git a/Utils/sync_single_cluster_container_scripts.sh b/Utils/sync_single_cluster_container_scripts.sh index 597775f..c167310 100755 --- a/Utils/sync_single_cluster_container_scripts.sh +++ b/Utils/sync_single_cluster_container_scripts.sh @@ -8,8 +8,13 @@ if test $# -ne 2; then exit 1 fi -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi host=$1 port=$2 diff --git a/Utils/sync_swarm.cs.pub.ro.sh b/Utils/sync_swarm.cs.pub.ro.sh index c465d39..698aff7 100755 --- a/Utils/sync_swarm.cs.pub.ro.sh +++ b/Utils/sync_swarm.cs.pub.ro.sh @@ -3,7 +3,12 @@ # Copyright: George Milescu 2010 - george.milescu@gmail.com # -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi rsync -avP --del $P2P_NEXT_REL_PATH george@swarm.cs.pub.ro:/home/george/P2P-Next diff --git a/Utils/sync_vm.sh b/Utils/sync_vm.sh index 00c09e3..81d4478 100755 --- a/Utils/sync_vm.sh +++ b/Utils/sync_vm.sh @@ -3,8 +3,13 @@ # Copyright: George Milescu 2010 - george.milescu@gmail.com # -# Read the global configuration variables -source ../ConfigFiles/globalconfig +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e ../ConfigFiles/globalconfig ]; then + echo "Warning: The global config file ../ConfigFiles/globalconfig does not exist." +else + source ../ConfigFiles/globalconfig +fi rsync -avP --del $P2P_NEXT_REL_PATH george@tracker.local:/home/george/P2P-Next rsync -avP --del $P2P_NEXT_REL_PATH george@coordinator.local:/home/george/P2P-Next -- 2.20.1