|
|
@@ -0,0 +1,24 @@
|
|
|
+#!/bin/bash
|
|
|
+# Licence : GPL v3
|
|
|
+# Author: Laurent HUBERT
|
|
|
+#
|
|
|
+# Renews the ssh server keys if they exist
|
|
|
+#
|
|
|
+cat <<EOF
|
|
|
+##################################
|
|
|
+# Renewing SSH server keys #
|
|
|
+##################################
|
|
|
+EOF
|
|
|
+status=0
|
|
|
+ls /etc/ssh/ssh_host_*key* > /dev/null 2>&1 && dpkg-reconfigure openssh-server || status=1
|
|
|
+if [ 0 -ne "$status" ]
|
|
|
+then
|
|
|
+ # Exit with non zero status
|
|
|
+ echo "Error renewing SSH keys"
|
|
|
+ exit 1
|
|
|
+else
|
|
|
+ cat <<-EOF
|
|
|
+# Renewing SSH server keys: OK #
|
|
|
+##################################
|
|
|
+EOF
|
|
|
+fi
|