about summary refs log tree commit diff stats
path: root/linux/scripts/setup-openssh.sh
diff options
context:
space:
mode:
authorbuilder <builder@host>2021-02-26 00:18:20 +0000
committerbuilder <builder@host>2021-02-26 00:18:20 +0000
commit2a862d9141a84b612ec2dd109a7f74a2b10ffb91 (patch)
tree037170f7158639bb6d43ac7ebc656df8e6dcc2bc /linux/scripts/setup-openssh.sh
parent88ad431d4bef94a816b4a1031fb5a62d4bd8a0d7 (diff)
downloaddoc-2a862d9141a84b612ec2dd109a7f74a2b10ffb91.tar.gz
tools scripts moved to linux
Diffstat (limited to 'linux/scripts/setup-openssh.sh')
-rw-r--r--linux/scripts/setup-openssh.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/linux/scripts/setup-openssh.sh b/linux/scripts/setup-openssh.sh
new file mode 100644
index 0000000..14afe8b
--- /dev/null
+++ b/linux/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;