[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-ramdisk/master] configs/setup: add stop_pause() to wait on user



commit c49f38422d362bbad0106fcf1264c05b7919626e
Author: Anthony G. Basile <blueness@xxxxxxxxxx>
Date:   Tue Feb 25 12:20:58 2014 -0500

    configs/setup: add stop_pause() to wait on user
---
 configs/setup |  101 +++++++++++++++------------------------------------------
 1 file changed, 26 insertions(+), 75 deletions(-)

diff --git a/configs/setup b/configs/setup
index 29ea00c..7f42d96 100644
--- a/configs/setup
+++ b/configs/setup
@@ -508,6 +508,13 @@ exporting()
 	fi
 }
 
+stop_pause() {
+	echo
+	echo -n "Hit enter to continue: "
+	read DUMMY
+	echo
+}
+
 
 NETWORK=0
 CONFIGURED=0
@@ -590,20 +597,14 @@ do
 				echo "<Network is up and running!>"
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		gettime)
 			echo
 			echo -n "The time is now: "
 			date
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		settime)
@@ -622,10 +623,7 @@ do
 			echo
 			echo -n "The time is now: "
 			date
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		netstatus)
@@ -634,23 +632,15 @@ do
 			if [ $NETWORK -ne 0 ]
 			then
 				ifconfig | more
-				echo -n "Hit enter to continue: "
-				read DUMMY
-				echo
+				stop_pause
 				route -n | more
-				echo
-				echo -n "Hit enter to continue: "
-				read DUMMY
-				echo
+				stop_pause
 				nslookup www.google.com | more
 			else
 				echo "*** FAILED network is not up yet! ***"
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		nettest)
@@ -683,17 +673,11 @@ do
 						&& echo "OK Host $PING Reacheable" \
 						|| echo "FAILED Host $PING Unreacheable"
 
-					echo
-					echo -n "Hit enter to continue: "
-					read DUMMY
-					echo
+					stop_pause
 				fi
 			else
 				echo "*** FAILED network is not up yet! ***"
-				echo
-				echo -n "Hit enter to continue: "
-				read DUMMY
-				echo
+				stop_pause
 			fi
 
 			;;
@@ -708,10 +692,7 @@ do
 				echo "*** FAILED network is not up yet! ***"
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		established)
@@ -724,10 +705,7 @@ do
 				echo "*** FAILED network is not up yet! ***"
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		torconf)
@@ -764,10 +742,7 @@ do
 				echo "*** FAILED network is not up yet! ***"
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		torstart)
@@ -801,10 +776,7 @@ do
 				fi
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		torreload)
@@ -825,10 +797,7 @@ do
 				fi
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		torstop)
@@ -849,37 +818,22 @@ do
 				fi
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		resources)
 			free
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			uptime
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			top
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		entropy)
 			echo -n "Available entropy: "
 			cat /proc/sys/kernel/random/entropy_avail
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		torexport)
@@ -910,10 +864,7 @@ do
 				fi
 			fi
 
-			echo
-			echo -n "Hit enter to continue: "
-			read DUMMY
-			echo
+			stop_pause
 			;;
 
 		reboot|shutdown)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits