Skip to content

Commit bef42ca

Browse files
authored
zfs-auto-snapshot needs multiverse (#721)
1 parent f00f45b commit bef42ca

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

lib.sh

+14-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ RORDIR=/opt/es/
1717

1818
# Ubuntu OS
1919
DISTRO=$(lsb_release -sd | cut -d ' ' -f 2)
20-
UNIV=$(apt-cache policy | grep http | awk '{print $3}' | grep universe | head -n 1 | cut -d "/" -f 2)
2120
# Network
2221
[ ! -z "$FIRST_IFACE" ] && IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}')
2322
IFACE2=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1)
@@ -747,12 +746,21 @@ fi
747746

748747
# Check universe reposiroty
749748
check_universe() {
750-
if [ "$UNIV" = "universe" ]
749+
UNIV=$(apt-cache policy | grep http | awk '{print $3}' | grep universe | head -n 1 | cut -d "/" -f 2)
750+
if [ "$UNIV" != "universe" ]
751751
then
752-
echo "Seems that required repositories are ok."
753-
else
754-
echo "Adding required repo (universe)."
755-
add-apt-repository universe
752+
echo "Adding required repo (universe)."
753+
add-apt-repository universe
754+
fi
755+
}
756+
757+
# Check universe reposiroty
758+
check_multiverse() {
759+
MULTIV=$(apt-cache policy | grep http | awk '{print $3}' | grep multiverse | head -n 1 | cut -d "/" -f 2)
760+
if [ "$MULTIV" != "multiverse" ]
761+
then
762+
echo "Adding required repo (multiverse)."
763+
add-apt-repository multiverse
756764
fi
757765
}
758766

nextcloud_install_production.sh

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ rm $SCRIPTS/adduser.sh
7373
# Check distrobution and version
7474
check_distro_version
7575
check_universe
76+
check_multiverse
7677

7778
# Check if key is available
7879
if ! wget -q -T 10 -t 2 "$NCREPO" > /dev/null

nextcloud_update.sh

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ if dpkg -l | grep libzfs2linux
271271
then
272272
if grep -r ncdata /etc/mtab
273273
then
274+
check_multiverse
274275
install_if_not zfs-auto-snapshot
275276
sed -i "s|date --utc|date|g" /usr/sbin/zfs-auto-snapshot
276277
check_command zfs-auto-snapshot -r ncdata

static/format-sdb.sh

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ true
1010
# Check if root
1111
root_check
1212

13+
# Needs to be Ubuntu 18.04 and Multiverse
14+
check_distro_version
15+
check_multiverse
16+
1317
LABEL_=ncdata
1418
MOUNT_=/mnt/$LABEL_
1519

0 commit comments

Comments
 (0)