Skip to content

Commit

Permalink
fix failing network, confirmed
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch85 committed Jun 7, 2016
1 parent cc8ad45 commit 3e61a0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions production/owncloud-startup-script.sh
Expand Up @@ -7,10 +7,7 @@ OCPATH=$WWW_ROOT/owncloud
OCDATA=/var/ocdata
SCRIPTS=/var/scripts
PW_FILE=/var/mysql_password.txt # Keep in sync with owncloud_install_production.sh
#IP="/sbin/ip"
IFACE=$(lshw -c network | grep "logical name" | awk '{print $3}')
#IFACE=$($IP -o link show | awk '{print $2,$9}' | grep "UP" | cut -d ":" -f 1)
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
CLEARBOOT=$(dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge)
PHPMYADMIN_CONF="/etc/apache2/conf-available/phpmyadmin.conf"
GITHUB_REPO="https://raw.githubusercontent.com/enoch85/ownCloud-VM/master/production"
Expand Down Expand Up @@ -47,6 +44,8 @@ wget -q --spider http://github.com
exit 1
fi

ADDRESS=$(hostname -I | cut -d ' ' -f 1)

echo "Getting scripts from GitHub to be able to run the first setup..."

# Get the latest owncloud_update.sh
Expand Down
3 changes: 1 addition & 2 deletions production/owncloud_install_production.sh
Expand Up @@ -29,8 +29,7 @@ OCDATA=/var/ocdata
SSL_CONF="/etc/apache2/sites-available/owncloud_ssl_domain_self_signed.conf"
HTTP_CONF="/etc/apache2/sites-available/owncloud_http_domain_self_signed.conf"
# Network
IP="/sbin/ip"
IFACE=$($IP -o link show | awk '{print $2,$9}' | grep "UP" | cut -d ":" -f 1)
IFACE=$(lshw -c network | grep "logical name" | awk '{print $3}')
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
# Repositories
GITHUB_REPO="https://raw.githubusercontent.com/enoch85/ownCloud-VM/master/production"
Expand Down
7 changes: 3 additions & 4 deletions static/ip.sh
@@ -1,10 +1,9 @@
#!/bin/sh

IFCONFIG="/sbin/ifconfig"
IP="/sbin/ip"
INTERFACES="/etc/network/interfaces"

IFACE=$($IP -o link show | awk '{print $2,$9}' | grep "UP" | cut -d ":" -f 1)
IFACE=$(lshw -c network | grep "logical name" | awk '{print $3}')
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
NETMASK=$($IFCONFIG | grep -w inet |grep -v 127.0.0.1| awk '{print $4}' | cut -d ":" -f 2)
GATEWAY=$(route -n|grep "UG"|grep -v "UGH"|cut -f 10 -d " ")
Expand All @@ -15,8 +14,8 @@ cat <<-IPCONFIG > "$INTERFACES"
iface lo inet loopback
iface $IFACE inet static
pre-up /sbin/ethtool -K $IFACE tso off
pre-up /sbin/ethtool -K $IFACE gso off
pre-up /sbin/ethtool -K $IFACE tso off
pre-up /sbin/ethtool -K $IFACE gso off
address $ADDRESS
netmask $NETMASK
Expand Down

0 comments on commit 3e61a0a

Please sign in to comment.