From 2d05ffb4bad93532e17b9350ff2d66fe3419cbe3 Mon Sep 17 00:00:00 2001
From: harlekin <harlekin>
Date: Tue, 05 Oct 2004 21:47:16 +0000
Subject: scripts to fix the stupid embedix rom inittab behavior

---
diff --git a/share/opie-console/sl6000_embedix_kill_0_1.sh b/share/opie-console/sl6000_embedix_kill_0_1.sh
new file mode 100644
index 0000000..369c23e
--- a/dev/null
+++ b/share/opie-console/sl6000_embedix_kill_0_1.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Use egrep to fid out if we need to comment /etc/sync/serialctl
+# from the inittab
+/usr/bin/env egrep -q '^pd:[0-9]:respawn:/etc/sync/serialctl' /etc/inittab 2>/dev/null
+
+# If egrep did not find an enabled /etc/sync/serialctl in /etc/inittab,
+# exit now (nothing to do)
+if [ $? -ne 0 ]; then
+  exit 0
+fi
+
+# This "cp -af" is to get the perms correct on /etc/inittab.tmp
+/usr/bin/env cp -af /etc/inittab /etc/inittab.tmp
+
+# This sed comments out the "etc/sync/serialctl" line
+/usr/bin/env sed 's%^\(pd:[0-9]:respawn:/etc/sync/serialctl\)%#\1%' /etc/inittab > /etc/inittab.tmp
+
+# We have not yet modified /etc/inittab, so to stay on the safe side
+# only modify it if the sed succeeded at what we asked it to do.
+if [ $? -eq 0 ]; then
+  # This "cp -af" puts the new /etc/inittab into place
+  /usr/bin/env cp -af /etc/inittab.tmp /etc/inittab
+  # Unlink the tmp file
+  rm /etc/inittab.tmp
+  # HUP init
+  /usr/bin/env kill -HUP 1
+fi
+
diff --git a/share/opie-console/sl6000_embedix_restart_0_1.sh b/share/opie-console/sl6000_embedix_restart_0_1.sh
new file mode 100644
index 0000000..4ce0e7e
--- a/dev/null
+++ b/share/opie-console/sl6000_embedix_restart_0_1.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Use egrep to fid out if we need to comment /etc/sync/serialctl
+# from the inittab
+/usr/bin/env egrep -q '^#pd:[0-9]:respawn:/etc/sync/serialctl' /etc/inittab 2>/dev/null
+
+# If egrep did not find an enabled /etc/sync/serialctl in /etc/inittab,
+# exit now (nothing to do)
+if [ $? -ne 0 ]; then
+  exit 0
+fi
+
+# This "cp -af" is to get the perms correct on /etc/inittab.tmp
+/usr/bin/env cp -af /etc/inittab /etc/inittab.tmp
+
+# This sed comments out the "etc/sync/serialctl" line
+/usr/bin/env sed 's%^#\(pd:[0-9]:respawn:/etc/sync/serialctl\)%\1%' /etc/inittab > /etc/inittab.tmp
+
+# We have not yet modified /etc/inittab, so to stay on the safe side
+# only modify it if the sed succeeded at what we asked it to do.
+if [ $? -eq 0 ]; then
+  # This "cp -af" puts the new /etc/inittab into place
+  /usr/bin/env cp -af /etc/inittab.tmp /etc/inittab
+  # Unlink the tmp file
+  rm /etc/inittab.tmp
+  # HUP init
+  /usr/bin/env kill -HUP 1
+fi
+
--
cgit v0.9.0.2