make sure omv-extras 7.x is installed

This commit is contained in:
Aaron Murray 2023-12-13 12:38:12 -06:00
parent b4fc345cae
commit 9615cf9e5e
2 changed files with 18 additions and 28 deletions

View File

@ -2,7 +2,7 @@
# #
# shellcheck disable=SC1090,SC1091,SC1117,SC2016,SC2046,SC2086 # shellcheck disable=SC1090,SC1091,SC1117,SC2016,SC2046,SC2086
# #
# version: 0.0.2 # version: 0.0.3
# #
if [[ $(id -u) -ne 0 ]]; then if [[ $(id -u) -ne 0 ]]; then
@ -21,13 +21,19 @@ if [ -f "/etc/apt/sources.list.d/pvekernel.list" ]; then
rm -fv /etc/apt/sources.list.d/pvekernel.list rm -fv /etc/apt/sources.list.d/pvekernel.list
fi fi
echo "Installing omv-extras 7.x ..."
url="https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/"
file="openmediavault-omvextrasorg_latest_all7.deb"
deb="omvextras7.deb"
wget "${url}/${file}" -O ${deb}
if [ -f "${deb}" ]; then
dpkg -i ${deb}
fi
echo "Clearing cache ..." echo "Clearing cache ..."
/usr/bin/salt-call --local saltutil.clear_cache /usr/bin/salt-call --local saltutil.clear_cache
omv-salt stage run prepare omv-salt stage run prepare
echo "Rebuilding sources.list* ..."
omv-salt deploy run apt omvextras
echo "Change to bullseye and shaitan just in case ..." echo "Change to bullseye and shaitan just in case ..."
sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list
sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list.d/* sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list.d/*

32
install
View File

@ -15,7 +15,7 @@
# #
logfile="omv_install.log" logfile="omv_install.log"
version="2.2.3" scriptversion="2.3.0"
_log() _log()
@ -24,7 +24,7 @@ _log()
echo "[$(date +'%Y-%m-%d %H:%M:%S%z')] [omvinstall] ${msg}" | tee -a ${logfile} echo "[$(date +'%Y-%m-%d %H:%M:%S%z')] [omvinstall] ${msg}" | tee -a ${logfile}
} }
_log "version :: ${version}" _log "script version :: ${scriptversion}"
if [[ $(id -u) -ne 0 ]]; then if [[ $(id -u) -ne 0 ]]; then
echo "This script must be executed as root or using sudo." echo "This script must be executed as root or using sudo."
@ -67,7 +67,6 @@ if grep -q 'machine-lxc' /proc/1/cgroup; then
fi fi
declare -i armbian=0 declare -i armbian=0
declare -i beta=0
declare -i cfg=0 declare -i cfg=0
declare -i ipv6=0 declare -i ipv6=0
declare -i rpi=0 declare -i rpi=0
@ -120,12 +119,9 @@ if [ -f /etc/armbian-release ]; then
_log "Armbian" _log "Armbian"
fi fi
while getopts "bfhimnr" opt; do while getopts "fhimnr" opt; do
_log "option ${opt}" _log "option ${opt}"
case "${opt}" in case "${opt}" in
b)
beta=1
;;
f) f)
skipFlash=1 skipFlash=1
;; ;;
@ -149,8 +145,8 @@ while getopts "bfhimnr" opt; do
echo "" echo ""
echo "Notes:" echo "Notes:"
echo " This script will always install:" echo " This script will always install:"
echo " - OMV 5.x on Debian 10 (Buster) EOL" echo " - OMV 6.x (shaitan) on Debian 11 (Bullseye)"
echo " - OMV 6.x on Debian 11 (Bullseye)" echo " - OMV 7.x (sandworm) on Debian 12 (Bookworm)"
echo "" echo ""
exit 100 exit 100
;; ;;
@ -216,33 +212,21 @@ codename="$(lsb_release --codename --short)"
_log "Codename :: ${codename}" _log "Codename :: ${codename}"
case ${codename} in case ${codename} in
buster)
keys="648ACFD622F3D138 112695A0E562B32A"
omvCodename="usul"
version=5
smbOptions="${smbOptions}\nwrite cache size = 524288"
_log "This version of OMV is End of Life. Please consider using OMV 6.x."
;;
bullseye) bullseye)
keys="0E98404D386FA1D9 A48449044AAD5C5D" keys="0E98404D386FA1D9 A48449044AAD5C5D"
omvCodename="shaitan" omvCodename="shaitan"
version=6 version=6
;; ;;
bookworm) bookworm)
if [ ${beta} -eq 1 ]; then omvCodename="sandworm"
omvCodename="sandworm" version=7
version=7
else
_log "Unsupported version. Only Debian 10 (Buster) and 11 (Bullseye) are supported. Exiting..."
exit 1
fi
_log "Copying /etc/resolv.conf to ${resolvTmp} ..." _log "Copying /etc/resolv.conf to ${resolvTmp} ..."
cp -fv /etc/resolv.conf "${resolvTmp}" cp -fv /etc/resolv.conf "${resolvTmp}"
_log "$(cat /etc/resolv.conf)" _log "$(cat /etc/resolv.conf)"
sshGrp="_ssh" sshGrp="_ssh"
;; ;;
*) *)
_log "Unsupported version. Only Debian 10 (Buster) and 11 (Bullseye) are supported. Exiting..." _log "Unsupported version. Only 11 (Bullseye) and 12 (Bookworm) are supported. Exiting..."
exit 1 exit 1
;; ;;
esac esac