Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
6669f83b
Commit
6669f83b
authored
Sep 01, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Plain Diff
install/upgrade ownCloud 7.0.2
Merge branch 'master' of github.com:jkaberg/mailinabox
parents
24ff0e04
7603ce04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
functions.sh
setup/functions.sh
+26
-6
owncloud.sh
setup/owncloud.sh
+10
-5
No files found.
setup/functions.sh
View file @
6669f83b
...
@@ -85,6 +85,9 @@ function get_default_privateip {
...
@@ -85,6 +85,9 @@ function get_default_privateip {
# Return the IP address of the network interface connected
# Return the IP address of the network interface connected
# to the Internet.
# to the Internet.
#
#
# Pass '4' or '6' as an argument to this function to specify
# what type of address to get (IPv4, IPv6).
#
# We used to use `hostname -I` and then filter for either
# We used to use `hostname -I` and then filter for either
# IPv4 or IPv6 addresses. However if there are multiple
# IPv4 or IPv6 addresses. However if there are multiple
# network interfaces on the machine, not all may be for
# network interfaces on the machine, not all may be for
...
@@ -99,11 +102,16 @@ function get_default_privateip {
...
@@ -99,11 +102,16 @@ function get_default_privateip {
# assigned to an interface. `ip route get` reports the
# assigned to an interface. `ip route get` reports the
# preferred. That's good enough for us. See issue #121.
# preferred. That's good enough for us. See issue #121.
#
#
# With IPv6, the best route may be via an interface that
# only has a link-local address (fe80::*). These addresses
# are only unique to an interface and so need an explicit
# interface specification in order to use them with bind().
# In these cases, we append "%interface" to the address.
# See the Notes section in the man page for getaddrinfo and
# https://discourse.mailinabox.email/t/update-broke-mailinabox/34/9.
#
# Also see ae67409603c49b7fa73c227449264ddd10aae6a9 and
# Also see ae67409603c49b7fa73c227449264ddd10aae6a9 and
# issue #3 for why/how we originally added IPv6.
# issue #3 for why/how we originally added IPv6.
#
# Pass '4' or '6' as an argument to this function to specify
# what type of address to get (IPv4, IPv6).
target
=
8.8.8.8
target
=
8.8.8.8
...
@@ -112,9 +120,21 @@ function get_default_privateip {
...
@@ -112,9 +120,21 @@ function get_default_privateip {
# as it's an address on the public Internet.
# as it's an address on the public Internet.
if
[
"
$1
"
==
"6"
]
;
then
target
=
2001:4860:4860::8888
;
fi
if
[
"
$1
"
==
"6"
]
;
then
target
=
2001:4860:4860::8888
;
fi
ip -
$1
-o
route get
$target
\
# Get the route information.
|
grep
-v
unreachable
\
route
=
$(
ip -
$1
-o
route get
$target
|
grep
-v
unreachable
)
|
sed
"s/.* src
\(
[^ ]*
\)
.*/
\1
/"
# Parse the address out of the route information.
address
=
$(
echo
$route
|
sed
"s/.* src
\(
[^ ]*
\)
.*/
\1
/"
)
if
[[
"
$1
"
==
"6"
&&
$address
==
fe80:
*
]]
;
then
# For IPv6 link-local addresses, parse the interface out
# of the route information and append it with a '%'.
interface
=
$(
echo
$route
|
sed
"s/.* dev
\(
[^ ]*
\)
.*/
\1
/"
)
address
=
$address
%
$interface
fi
echo
$address
}
}
function
ufw_allow
{
function
ufw_allow
{
...
...
setup/owncloud.sh
View file @
6669f83b
...
@@ -12,13 +12,18 @@ apt_install \
...
@@ -12,13 +12,18 @@ apt_install \
apt-get purge
-qq
-y
owncloud
*
apt-get purge
-qq
-y
owncloud
*
# Install ownCloud from source if it is not already present
# Install ownCloud from source
# TODO: Check version?
owncloud_ver
=
7.0.2
if
[
!
-d
/usr/local/lib/owncloud
]
;
then
# Check if ownCloud dir exist, and check if version matches owncloud_ver (if either doesn't - install/upgrade)
if
[
!
-d
/usr/local/lib/owncloud/
]
\
||
!
grep
-q
$owncloud_ver
/usr/local/lib/owncloud/version.php
;
then
echo
installing ownCloud...
echo
installing ownCloud...
rm
-f
/tmp/owncloud.zip
rm
-f
/tmp/owncloud.zip
wget
-qO
/tmp/owncloud.zip https://download.owncloud.org/community/owncloud-7.0.1.zip
wget
-qO
/tmp/owncloud.zip https://download.owncloud.org/community/owncloud-
$owncloud_ver
.zip
unzip
-q
/tmp/owncloud.zip
-d
/usr/local/lib
unzip
-u
-o
-q
/tmp/owncloud.zip
-d
/usr/local/lib
#either extracts new or replaces current files
hide_output php /usr/local/lib/owncloud/occ upgrade
#if OC is up-to-date it wont matter
rm
-f
/tmp/owncloud.zip
rm
-f
/tmp/owncloud.zip
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment