summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
authorDmitrii Morozov <snoopdesigns@gmail.com>2025-11-26 00:35:42 +0100
committerDmitrii Morozov <snoopdesigns@gmail.com>2025-11-26 00:35:42 +0100
commitc2bb934a0eff7ccb47699ce20e390c318e0191c2 (patch)
tree9df759b0a594647c0219ebe77c04ee44b0f17a5f /systemd
parentc9083542f68faaa6329f71bfaf90ee44d7b1ae39 (diff)
Auto reset DevMode session on startupHEADmaster
Diffstat (limited to 'systemd')
-rwxr-xr-xsystemd/magic4linux-start13
1 files changed, 12 insertions, 1 deletions
diff --git a/systemd/magic4linux-start b/systemd/magic4linux-start
index 587205b..9ed9597 100755
--- a/systemd/magic4linux-start
+++ b/systemd/magic4linux-start
@@ -38,7 +38,12 @@ function install_magic4pc() {
function check_magic4pc_running() {
$ARES_LAUNCH_CMD -r | grep -q 'me.wouterdek.magic4pc'
return $?
-}
+}
+
+function reset_dev_mode_session() {
+ $ARES_LAUNCH_CMD com.palmdts.devmode -p '{"extend":true}'
+ return $?
+}
function start_magic4pc() {
$ARES_LAUNCH_CMD me.wouterdek.magic4pc
@@ -62,6 +67,12 @@ if ares_available; then
if check_magic4pc_running; then
echo "WebOS Magic4pc application is already running"
else
+ echo "Resetting DevMode session.."
+ if reset_dev_mode_session; then
+ echo "DevMode session reset successfully"
+ else
+ exit 1
+ fi
echo "WebOS Magic4pc application not running, starting.."
if start_magic4pc; then
echo "Magic4pc started"