mirror of
https://github.com/nextcloud/vm.git
synced 2025-10-26 11:27:32 +00:00
zfs-auto-snapshot needs multiverse (#721)
This commit is contained in:
parent
f00f45bf9a
commit
bef42ca800
20
lib.sh
20
lib.sh
@ -17,7 +17,6 @@ RORDIR=/opt/es/
|
||||
|
||||
# Ubuntu OS
|
||||
DISTRO=$(lsb_release -sd | cut -d ' ' -f 2)
|
||||
UNIV=$(apt-cache policy | grep http | awk '{print $3}' | grep universe | head -n 1 | cut -d "/" -f 2)
|
||||
# Network
|
||||
[ ! -z "$FIRST_IFACE" ] && IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}')
|
||||
IFACE2=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1)
|
||||
@ -747,12 +746,21 @@ fi
|
||||
|
||||
# Check universe reposiroty
|
||||
check_universe() {
|
||||
if [ "$UNIV" = "universe" ]
|
||||
UNIV=$(apt-cache policy | grep http | awk '{print $3}' | grep universe | head -n 1 | cut -d "/" -f 2)
|
||||
if [ "$UNIV" != "universe" ]
|
||||
then
|
||||
echo "Seems that required repositories are ok."
|
||||
else
|
||||
echo "Adding required repo (universe)."
|
||||
add-apt-repository universe
|
||||
echo "Adding required repo (universe)."
|
||||
add-apt-repository universe
|
||||
fi
|
||||
}
|
||||
|
||||
# Check universe reposiroty
|
||||
check_multiverse() {
|
||||
MULTIV=$(apt-cache policy | grep http | awk '{print $3}' | grep multiverse | head -n 1 | cut -d "/" -f 2)
|
||||
if [ "$MULTIV" != "multiverse" ]
|
||||
then
|
||||
echo "Adding required repo (multiverse)."
|
||||
add-apt-repository multiverse
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@ -73,6 +73,7 @@ rm $SCRIPTS/adduser.sh
|
||||
# Check distrobution and version
|
||||
check_distro_version
|
||||
check_universe
|
||||
check_multiverse
|
||||
|
||||
# Check if key is available
|
||||
if ! wget -q -T 10 -t 2 "$NCREPO" > /dev/null
|
||||
|
||||
@ -271,6 +271,7 @@ if dpkg -l | grep libzfs2linux
|
||||
then
|
||||
if grep -r ncdata /etc/mtab
|
||||
then
|
||||
check_multiverse
|
||||
install_if_not zfs-auto-snapshot
|
||||
sed -i "s|date --utc|date|g" /usr/sbin/zfs-auto-snapshot
|
||||
check_command zfs-auto-snapshot -r ncdata
|
||||
|
||||
@ -10,6 +10,10 @@ true
|
||||
# Check if root
|
||||
root_check
|
||||
|
||||
# Needs to be Ubuntu 18.04 and Multiverse
|
||||
check_distro_version
|
||||
check_multiverse
|
||||
|
||||
LABEL_=ncdata
|
||||
MOUNT_=/mnt/$LABEL_
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user