about summary refs log tree commit diff stats
path: root/tools/scripts/setup-openssh.sh
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2016-10-15 02:25:21 +0100
committerSilvino Silva <silvino@bk.ru>2016-10-15 02:25:21 +0100
commit5221508bbc3f4cb62b5d61655c1cb9e786fb40e1 (patch)
tree223917b18f39f37c5c1caa55bdde924fa51bce4d /tools/scripts/setup-openssh.sh
parent6438abf18c580d8440f5da350716a530056a8330 (diff)
parenta2e804ad93ef562c299dfad49eb890c8d7d24010 (diff)
downloaddoc-5221508bbc3f4cb62b5d61655c1cb9e786fb40e1.tar.gz
revision 0.2.5 merged to develop
Diffstat (limited to 'tools/scripts/setup-openssh.sh')
-rw-r--r--tools/scripts/setup-openssh.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/scripts/setup-openssh.sh b/tools/scripts/setup-openssh.sh
new file mode 100644
index 0000000..14afe8b
--- /dev/null
+++ b/tools/scripts/setup-openssh.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# First we define the function
+ConfirmOrExit ()
+{
+    while true
+    do
+        echo -n "Please confirm (y or n) :"
+        read CONFIRM
+        case $CONFIRM in
+            y|Y|YES|yes|Yes) break ;;
+            n|N|no|NO|No)
+                echo "Aborting - you entered $CONFIRM"
+                exit
+                ;;
+            *) echo "Please enter only y or n"
+        esac
+    done
+    echo "You entered $CONFIRM. Continuing ..."
+}
+
+
+# Absolute path to this script, e.g. /home/user/bin/foo.sh
+SCRIPT=$(readlink -f "$0")
+# Absolute path this script is in, thus /home/user/bin
+SCRIPTPATH=$(dirname "$SCRIPT")
+
+DIR=$(dirname "$SCRIPTPATH");
+DIR_CONF=$DIR"/conf"
+
+echo "SCRIPT=$SCRIPT";
+echo "SCRIPTPATH=$SCRIPTPATH";
+echo "DIR=$DIR";
+echo "DIR_CONF=$DIR_CONF";
+ConfirmOrExit
+
+
+    #installer overwrite system init script
+    cp -R $DIR_CONF/etc/ssh/sshd_config /etc/ssh/sshd_config
+
+    sh /etc/rc.d/sshd start
+
+exit 0;