summarylogtreecommitdiffstats
path: root/trueport-install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'trueport-install.sh')
-rw-r--r--trueport-install.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/trueport-install.sh b/trueport-install.sh
new file mode 100644
index 00000000000..38a5b480517
--- /dev/null
+++ b/trueport-install.sh
@@ -0,0 +1,47 @@
+post_upgrade() {
+ set -u
+ systemctl daemon-reload
+ # Handle the module update if DKMS doesn't
+ if [ ! -d /usr/src/trueport-*/ ]; then
+ depmod -a
+ if systemctl -q is-enabled 'trueport.service'; then
+ systemctl start 'trueport.service'
+ fi
+ fi
+ #echo 'Perle TruePort (ptyx) startup scripts updated or installed'
+ set +u
+}
+
+post_install() {
+ set -u
+ local _tp_configps
+ local _tp_config
+ for _tp_configps in /etc/trueport/*.pacsave; do
+ _tp_config="${_tp_configps%\.pacsave}"
+ if [ ! -s "${_tp_config}" ]; then
+ mv "${_tp_configps}" "${_tp_config}"
+ fi
+ done
+ set +u
+ post_upgrade
+}
+
+pre_upgrade() {
+ set -u
+ if [ ! -d /usr/src/trueport-*/ ]; then
+ systemctl stop 'trueport.service' # also rmmod the module
+ killall 'trueportd' # the service doesn't stop trueportd started manually
+ fi
+ set +u
+}
+
+pre_remove() {
+ pre_upgrade
+}
+
+post_remove() {
+ set -u
+ systemctl daemon-reload
+ #echo 'Perle TruePort (ptyx) startup scripts removed'
+ set +u
+}