author | sandman <sandman> | 2002-12-17 22:39:52 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-17 22:39:52 (UTC) |
commit | 1a5f632aabbd2b53a215828caf6fe208e0ff7f14 (patch) (unidiff) | |
tree | cda7cb34bd653f05f9d90e229af42fb48050c528 /root | |
parent | 995f9ff51e4a687471500765ff40aea27a677197 (diff) | |
download | opie-1a5f632aabbd2b53a215828caf6fe208e0ff7f14.zip opie-1a5f632aabbd2b53a215828caf6fe208e0ff7f14.tar.gz opie-1a5f632aabbd2b53a215828caf6fe208e0ff7f14.tar.bz2 |
rewritten - opie-login doesn't need the ssh stuff for root
also moved the QWS_DISPLAY stuff into the global scope to make it easier to
set all Opie env.vars. with: . /etc/init.d/opie
-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 | |||
@@ -1,93 +1,85 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
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 |
8 | export QPEDIR=/opt/QtPalmtop | 9 | export QPEDIR=/opt/QtPalmtop |
9 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPIEDIR/lib | 10 | 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 |
14 | exit 0 | 31 | exit 0 |
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 | ||