summaryrefslogtreecommitdiff
path: root/s3_mountscripts.sh
diff options
context:
space:
mode:
Diffstat (limited to 's3_mountscripts.sh')
-rwxr-xr-xs3_mountscripts.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/s3_mountscripts.sh b/s3_mountscripts.sh
new file mode 100755
index 0000000..a7b6c6b
--- /dev/null
+++ b/s3_mountscripts.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+# File: /root/s3_mountscripts.sh
+# Package: deployscripts
+# Author: bgstack15
+# Startdate: 2015
+# Title: Template Script 3: Mount Scripts Directory
+# Purpose: Mounts the network mount for this organization
+# History: 2016-05-19 given original headers
+# Usage: ./s3[tab][enter]
+# Reference:
+# Improve:
+
+server=$( hostname )
+ipaddr=$( ifconfig | grep -E "Bcast|broadcast" | awk '{print $2}' | sed 's/[^0-9\.]//g;' )
+sdir=/mnt/scripts
+
+if [[ ! "$1" = "-y" ]];
+then
+ cat <<EOFNOTICE
+ensure on norite.example.com:
+ 1. /etc/exports is allowing this host ("${server}")
+ 2. /etc/sysconfig/iptables allows this ip address ("${ipaddr}")
+ 3. service nfs restart
+ 4. service iptables restart
+rerun this script with "-y"
+
+References:
+https://protect.example.com/wiki/display/itops/norite
+EOFNOTICE
+else
+ # so "-y" was used
+ [[ ! -d ${sdir} ]] && mkdir -p ${sdir} 2>/dev/null
+ #mount -t nfs norite.example.com:/mnt/scripts /mnt/scripts
+ mount /mnt/scripts #it better be in /etc/fstab!
+fi
bgstack15