From bcfeea525d38a7266d3abfa507d0de6dfcd31336 Mon Sep 17 00:00:00 2001 From: rautenberg Date: Fri, 7 Sep 2012 16:21:58 +0200 Subject: add silent parameter --- install | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/install b/install index 66dc4e2..49204ff 100755 --- a/install +++ b/install @@ -5,10 +5,19 @@ [ "`id -u`" = "0" ] && echo "This script must not be run as root" 1>&2 && exit 1 +SILENT=false +if [ -n "$1" ] +then + if [ "$1" = "silent" ] + then + SILENT=true + fi +fi + echo echo "OpenTox Ruby" echo "Hit If all services are stoppped, else hit ." -read delete_me +[ $SILENT = false ] && read delete_me echo "Note: CONFIG (~/.opentox) will be backupped." mkdir -p $OT_PREFIX/tmp/ >/dev/null 2>&1 @@ -30,7 +39,7 @@ check_log `basename $0` echo echo "Welcome to base installation for OpenTox compatible services on Ruby and Debian." echo "IMPORTANT: Hit to adjust config.sh first ( to continue)." -read delete_me +[ $SILENT = false ] && read delete_me echo echo -n "We need to do some privileged action. " sudo echo -n "" -- cgit v1.2.3 From 0d2ae7da85f0e7857547d1534bf583a33da8a511 Mon Sep 17 00:00:00 2001 From: rautenberg Date: Mon, 10 Sep 2012 10:45:26 +0200 Subject: reduce some echo stuff for silent mode --- install | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/install b/install index 49204ff..299fff6 100755 --- a/install +++ b/install @@ -14,10 +14,12 @@ then fi fi -echo -echo "OpenTox Ruby" -echo "Hit If all services are stoppped, else hit ." -[ $SILENT = false ] && read delete_me +if [ $SILENT = false ]; then + echo + echo "OpenTox Ruby" + echo "Hit If all services are stoppped, else hit ." + read delete_me +fi echo "Note: CONFIG (~/.opentox) will be backupped." mkdir -p $OT_PREFIX/tmp/ >/dev/null 2>&1 @@ -36,10 +38,13 @@ echo "Backup finished." . ./utils.sh check_log `basename $0` -echo -echo "Welcome to base installation for OpenTox compatible services on Ruby and Debian." -echo "IMPORTANT: Hit to adjust config.sh first ( to continue)." -[ $SILENT = false ] && read delete_me +if [ $SILENT = false ]; then + echo + echo "Welcome to base installation for OpenTox compatible services on Ruby and Debian." + echo "IMPORTANT: Hit to adjust config.sh first ( to continue)." + read delete_me +fi + echo echo -n "We need to do some privileged action. " sudo echo -n "" -- cgit v1.2.3