author | sandman <sandman> | 2002-12-17 22:39:52 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-17 22:39:52 (UTC) |
commit | 1a5f632aabbd2b53a215828caf6fe208e0ff7f14 (patch) (side-by-side diff) | |
tree | cda7cb34bd653f05f9d90e229af42fb48050c528 /root/etc | |
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 | 74 |
1 files changed, 33 insertions, 41 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 @@ -3,4 +3,5 @@ -export LOGNAME=root -export HOME=/$LOGNAME +[ -z $LOGNAME ] && export LOGNAME=root +[ -z $HOME ] && export HOME=/$LOGNAME + export QTDIR=/opt/QtPalmtop @@ -11,2 +12,18 @@ export PATH=$PATH:$OPIEDIR/bin +if [ -e /proc/hal/model ] ; then + ipaq=`cat /proc/hal/model` + + case "$ipaq" in + "3100" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; + "3600" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; + "3700" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; + "3800" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; + "3900" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; + *) echo "Unknown iPAQ model: $ipaq" ;; + esac +else + export QWS_DISPLAY=Transformed:Rot270:0 +fi + + if [ ! -x $OPIEDIR/bin/qpe ] ; then @@ -16,14 +33,6 @@ fi -$OPIEDIR/bin/opie-reorgfiles - . /etc/profile -killproc() { - pid=`/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'` - [ "$pid" != "" ] && kill $pid -} - case $1 in 'start') - cd $HOME @@ -31,20 +40,12 @@ case $1 in - if [ -e /proc/hal/model ] ; then - - IPAQ=`cat /proc/hal/model` - - echo iPAQ type $IPAQ - case $IPAQ in - "3100" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; - "3600" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; - "3700" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; - "3800" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; - "3900" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; - *) echo "Unknown processor type -`module_id`-!" ;; - esac + if [ -x $OPIEDIR/bin/opie-login ]; then + if ! killall -0 syslogd 2>/dev/null >/dev/null; then + echo Starting Opie-login.... + $OPIEDIR/bin/opie-login 2>/dev/null >/dev/null & else - export QWS_DISPLAY=Transformed:Rot270:0 + echo Starting Opie-login with syslog logging..... + ( $OPIEDIR/bin/opie-login 2>&1 | logger ) & fi - - + else + $OPIEDIR/bin/opie-reorgfiles if [ -x /usr/bin/ssh-agent ]; then @@ -59,11 +60,2 @@ case $1 in - if [ -x $OPIEDIR/bin/opie-login ]; then - if ! killall -0 syslogd 2>/dev/null >/dev/null; then - echo Starting Opie-login.... - $SSHAGENT $OPIEDIR/bin/opie-login 2>/dev/null >/dev/null & - else - echo Starting Opie-login with syslog logging..... - ($SSHAGENT $OPIEDIR/bin/opie-login 2>&1 | logger ) & - fi - else if ! killall -0 syslogd 2>/dev/null >/dev/null; then @@ -78,15 +70,15 @@ case $1 in ;; + 'stop') echo "Killing Opie..." - if [ -f /var/run/opie.pid ]; then - kill -TERM `cat /var/run/opie.pid` - else - killproc qpe - fi + killall qpe + killall opie-login - killproc opie-login ;; + *) echo "usage: $0 { start | stop }" + ;; + esac |