summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/tools/posbox/configuration/posbox_update.sh
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/point_of_sale/tools/posbox/configuration/posbox_update.sh
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/point_of_sale/tools/posbox/configuration/posbox_update.sh')
-rwxr-xr-xaddons/point_of_sale/tools/posbox/configuration/posbox_update.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/addons/point_of_sale/tools/posbox/configuration/posbox_update.sh b/addons/point_of_sale/tools/posbox/configuration/posbox_update.sh
new file mode 100755
index 00000000..2bfb9f3a
--- /dev/null
+++ b/addons/point_of_sale/tools/posbox/configuration/posbox_update.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+sudo mount -o remount,rw /
+
+sudo service led-status stop
+
+cd /home/pi/odoo
+localbranch=$(git symbolic-ref -q --short HEAD)
+localremote=$(git config branch.$localbranch.remote)
+
+echo "addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo" >> .git/info/sparse-checkout
+
+git fetch "${localremote}" "${localbranch}" --depth=1
+git reset "${localremote}"/"${localbranch}" --hard
+
+git clean -df
+cp -a /home/pi/odoo/addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/* /home/pi/odoo/
+rm -r /home/pi/odoo/addons/point_of_sale/tools/posbox/overwrite_after_init
+
+sudo find / -type f -name "*.iotpatch" 2> /dev/null | while read iotpatch; do
+ DIR=$(dirname "${iotpatch}")
+ BASE=$(basename "${iotpatch%.iotpatch}")
+ sudo find "${DIR}" -type f -name "${BASE}" ! -name "*.iotpatch" | while read file; do
+ sudo patch -f "${file}" < "${iotpatch}"
+ done
+done
+
+sudo mount -o remount,ro /
+sudo mount -o remount,rw /root_bypass_ramdisks/etc/cups
+
+sudo service led-status start
+
+(sleep 5 && sudo service odoo restart) &