changeset 101:8b15a38ccd0f

* fix vpns * create a flatten function
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 28 Oct 2010 13:05:56 -0700
parents 3016fa6a7c13
children 35d28c0a6ba3
files .bashrc bin/vpn-mpt.sh bin/vpn-office.sh
diffstat 3 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.bashrc	Mon Oct 25 08:18:00 2010 -0700
+++ b/.bashrc	Thu Oct 28 13:05:56 2010 -0700
@@ -290,6 +290,28 @@
 echo "default-push = ssh://${ROOT#http*://}"
 }
 
+flatten() {
+  directory=$PWD
+  if [ "$#" == "1" ]
+  then
+      directory=$1
+  fi
+  cd $directory
+  unset find # don't use the alias
+  find -name '*' -type f | sed 's/.\///' | while read line
+  do
+      filename=$(echo $line | sed 's/\//-/g')
+      mv "${line}" "${filename}"
+  done
+  for i in *
+  do
+      if [ -d $i ]
+      then
+          rm -rf "${i}"
+      fi
+  done
+}
+
 ### include overrides for commands
 source ~/.bash_overrides
 
--- a/bin/vpn-mpt.sh	Mon Oct 25 08:18:00 2010 -0700
+++ b/bin/vpn-mpt.sh	Thu Oct 28 13:05:56 2010 -0700
@@ -1,5 +1,5 @@
 #!/bin/bash
 
-sudo openvpn --daemon --config /home/jhammel/mozilla/vpn/MPT-vpn/Mozilla-MPT.ovpn --script-security 3
-sudo openvpn --daemon --config /home/jhammel/mozilla/vpn/Office-vpn/Mozilla-MV-Office.ovpn --script-security 3
+cd /home/jhammel/mozilla/vpn/MPT-vpn/
+sudo openvpn --daemon --config Mozilla-MPT.ovpn --script-security 3
 tail -f /var/log/syslog
\ No newline at end of file
--- a/bin/vpn-office.sh	Mon Oct 25 08:18:00 2010 -0700
+++ b/bin/vpn-office.sh	Thu Oct 28 13:05:56 2010 -0700
@@ -1,5 +1,5 @@
 #!/bin/bash
 
-sudo openvpn --daemon --config /home/jhammel/mozilla/vpn/MPT-vpn/Mozilla-MPT.ovpn --script-security 3
-sudo openvpn --daemon --config /home/jhammel/mozilla/vpn/Office-vpn/Mozilla-MV-Office.ovpn --script-security 3
+cd /home/jhammel/mozilla/vpn/Office-vpn/
+sudo openvpn --daemon --config Mozilla-MV-Office.ovpn --script-security 3
 tail -f /var/log/syslog
\ No newline at end of file