2022-12-18 10:36:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
patchv22120(){
|
|
|
|
echo "Applying 22.12 HotPatch 1"
|
2022-12-27 12:04:26 +00:00
|
|
|
|
2022-12-27 12:38:41 +00:00
|
|
|
( wget -q -P /tmp https://github.com/truecharts/truetool/raw/main/hotpatch/2212/HP1.patch && echo "download completed" || echo "download failed" ) && ( patch -N -s -p0 -d /usr/lib/python3/dist-packages/middlewared/ &>/dev/null < /tmp/HP1.patch && restartmiddleware=yes && echo "patch completed" || echo "Patch Already Applied" ) && rm -rf /tmp/HP1.patch
|
2022-12-27 12:04:26 +00:00
|
|
|
|
2022-12-26 20:35:38 +00:00
|
|
|
echo "Applying 22.12 HotPatch 2"
|
2022-12-27 12:38:41 +00:00
|
|
|
( wget -q -P /tmp https://github.com/truecharts/truetool/raw/main/hotpatch/2212/HP2.patch && echo "download completed" || echo "download failed" ) && ( patch -N -s -p0 -d /usr/lib/python3/dist-packages/middlewared/ &>/dev/null < /tmp/HP2.patch && restartmiddleware=yes && echo "patch completed" || echo "Patch Already Applied" ) && rm -rf /tmp/HP2.patch
|
2022-12-18 10:36:53 +00:00
|
|
|
}
|
|
|
|
export -f patchv22120
|
|
|
|
|
|
|
|
|
2022-12-27 12:04:26 +00:00
|
|
|
|
|
|
|
|
2022-12-18 10:36:53 +00:00
|
|
|
hotpatch(){
|
|
|
|
echo "Starting hotpatcher..."
|
2022-12-27 12:04:26 +00:00
|
|
|
restartmiddleware=no
|
|
|
|
if (( "$scaleVersion" == 22120 )); then
|
2022-12-18 10:36:53 +00:00
|
|
|
patchv22120
|
2022-12-27 12:04:26 +00:00
|
|
|
else
|
|
|
|
echo "No hotpatch available for your version, congratulations!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( "$restartmiddleware" == "yes" )); then
|
|
|
|
middlewareRestart
|
2022-12-18 10:36:53 +00:00
|
|
|
fi
|
|
|
|
}
|
2022-12-18 10:38:18 +00:00
|
|
|
export -f hotpatch
|