-rwxr-xr-x | root/etc/init.d/opie | 126 |
1 files changed, 59 insertions, 67 deletions
diff --git a/root/etc/init.d/opie b/root/etc/init.d/opie index 61de104..8151b8f 100755 --- a/root/etc/init.d/opie +++ b/root/etc/init.d/opie | |||
@@ -2,6 +2,7 @@ | |||
2 | # | 2 | # |
3 | 3 | ||
4 | export LOGNAME=root | 4 | [ -z $LOGNAME ] && export LOGNAME=root |
5 | export HOME=/$LOGNAME | 5 | [ -z $HOME ] && export HOME=/$LOGNAME |
6 | |||
6 | export QTDIR=/opt/QtPalmtop | 7 | export QTDIR=/opt/QtPalmtop |
7 | export OPIEDIR=/opt/QtPalmtop | 8 | export OPIEDIR=/opt/QtPalmtop |
@@ -10,4 +11,20 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPIEDIR/lib | |||
10 | export PATH=$PATH:$OPIEDIR/bin | 11 | export PATH=$PATH:$OPIEDIR/bin |
11 | 12 | ||
13 | if [ -e /proc/hal/model ] ; then | ||
14 | ipaq=`cat /proc/hal/model` | ||
15 | |||
16 | case "$ipaq" in | ||
17 | "3100" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; | ||
18 | "3600" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | ||
19 | "3700" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | ||
20 | "3800" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; | ||
21 | "3900" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | ||
22 | *) echo "Unknown iPAQ model: $ipaq" ;; | ||
23 | esac | ||
24 | else | ||
25 | export QWS_DISPLAY=Transformed:Rot270:0 | ||
26 | fi | ||
27 | |||
28 | |||
12 | if [ ! -x $OPIEDIR/bin/qpe ] ; then | 29 | if [ ! -x $OPIEDIR/bin/qpe ] ; then |
13 | echo Opie not installed | 30 | echo Opie not installed |
@@ -15,79 +32,54 @@ if [ ! -x $OPIEDIR/bin/qpe ] ; then | |||
15 | fi | 32 | fi |
16 | 33 | ||
17 | $OPIEDIR/bin/opie-reorgfiles | ||
18 | |||
19 | . /etc/profile | 34 | . /etc/profile |
20 | 35 | ||
21 | killproc() { | ||
22 | pid=`/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'` | ||
23 | [ "$pid" != "" ] && kill $pid | ||
24 | } | ||
25 | |||
26 | case $1 in | 36 | case $1 in |
27 | 'start') | 37 | 'start') |
38 | cd $HOME | ||
39 | rm -f /etc/rc2.d/S99x # Can't have both running! | ||
40 | |||
41 | if [ -x $OPIEDIR/bin/opie-login ]; then | ||
42 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then | ||
43 | echo Starting Opie-login.... | ||
44 | $OPIEDIR/bin/opie-login 2>/dev/null >/dev/null & | ||
45 | else | ||
46 | echo Starting Opie-login with syslog logging..... | ||
47 | ( $OPIEDIR/bin/opie-login 2>&1 | logger ) & | ||
48 | fi | ||
49 | else | ||
50 | $OPIEDIR/bin/opie-reorgfiles | ||
51 | if [ -x /usr/bin/ssh-agent ]; then | ||
52 | SSHAGENT=/usr/bin/ssh-agent | ||
53 | else | ||
54 | SSHAGENT="" | ||
55 | fi | ||
56 | |||
57 | if [ -x $OPIEDIR/bin/opie-sh-ssh-askpass.sh ]; then | ||
58 | export SSH_ASKPASS=$OPIEDIR/bin/opie-sh-ssh-askpass.sh | ||
59 | fi | ||
60 | |||
61 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then | ||
62 | echo Starting Opie.... | ||
63 | $SSHAGENT $OPIEDIR/bin/qpe 2>/dev/null >/dev/null & | ||
64 | else | ||
65 | echo Starting Opie with syslog logging..... | ||
66 | ( $SSHAGENT $OPIEDIR/bin/qpe 2>&1 | logger ) & | ||
67 | fi | ||
68 | fi | ||
28 | 69 | ||
29 | cd $HOME | 70 | ;; |
30 | rm -f /etc/rc2.d/S99x # Can't have both running! | ||
31 | |||
32 | if [ -e /proc/hal/model ] ; then | ||
33 | |||
34 | IPAQ=`cat /proc/hal/model` | ||
35 | |||
36 | echo iPAQ type $IPAQ | ||
37 | case $IPAQ in | ||
38 | "3100" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; | ||
39 | "3600" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | ||
40 | "3700" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | ||
41 | "3800" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; | ||
42 | "3900" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | ||
43 | *) echo "Unknown processor type -`module_id`-!" ;; | ||
44 | esac | ||
45 | else | ||
46 | export QWS_DISPLAY=Transformed:Rot270:0 | ||
47 | fi | ||
48 | 71 | ||
49 | 72 | 'stop') | |
50 | if [ -x /usr/bin/ssh-agent ]; then | 73 | echo "Killing Opie..." |
51 | SSHAGENT=/usr/bin/ssh-agent | 74 | killall qpe |
52 | else | 75 | killall opie-login |
53 | SSHAGENT="" | ||
54 | fi | ||
55 | 76 | ||
56 | if [ -x $OPIEDIR/bin/opie-sh-ssh-askpass.sh ]; then | 77 | ;; |
57 | export SSH_ASKPASS=$OPIEDIR/bin/opie-sh-ssh-askpass.sh | ||
58 | fi | ||
59 | 78 | ||
60 | if [ -x $OPIEDIR/bin/opie-login ]; then | 79 | *) |
61 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then | 80 | echo "usage: $0 { start | stop }" |
62 | echo Starting Opie-login.... | ||
63 | $SSHAGENT $OPIEDIR/bin/opie-login 2>/dev/null >/dev/null & | ||
64 | else | ||
65 | echo Starting Opie-login with syslog logging..... | ||
66 | ($SSHAGENT $OPIEDIR/bin/opie-login 2>&1 | logger ) & | ||
67 | fi | ||
68 | else | ||
69 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then | ||
70 | echo Starting Opie.... | ||
71 | $SSHAGENT $OPIEDIR/bin/qpe 2>/dev/null >/dev/null & | ||
72 | else | ||
73 | echo Starting Opie with syslog logging..... | ||
74 | ($SSHAGENT $OPIEDIR/bin/qpe 2>&1 | logger ) & | ||
75 | fi | ||
76 | fi | ||
77 | 81 | ||
78 | ;; | 82 | ;; |
79 | 'stop') | ||
80 | echo "Killing Opie..." | ||
81 | if [ -f /var/run/opie.pid ]; then | ||
82 | kill -TERM `cat /var/run/opie.pid` | ||
83 | else | ||
84 | killproc qpe | ||
85 | fi | ||
86 | 83 | ||
87 | killproc opie-login | ||
88 | ;; | ||
89 | *) | ||
90 | echo "usage: $0 { start | stop }" | ||
91 | ;; | ||
92 | esac | 84 | esac |
93 | 85 | ||