summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-01-28 19:41:03 (UTC)
committer kergoth <kergoth>2003-01-28 19:41:03 (UTC)
commitc73371101f28e1c28837b35c62fde18f16dfb32f (patch) (unidiff)
treedb55da47d73692283df2b657963d8b8c85195c37
parent7cf931b1571a65212f6b085e3c04087f03430d40 (diff)
downloadopie-c73371101f28e1c28837b35c62fde18f16dfb32f.zip
opie-c73371101f28e1c28837b35c62fde18f16dfb32f.tar.gz
opie-c73371101f28e1c28837b35c62fde18f16dfb32f.tar.bz2
Script cleanup
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--share/opie-login/post-session25
-rw-r--r--share/opie-login/pre-session31
2 files changed, 27 insertions, 29 deletions
diff --git a/share/opie-login/post-session b/share/opie-login/post-session
index cc0030e..7016743 100644
--- a/share/opie-login/post-session
+++ b/share/opie-login/post-session
@@ -1,11 +1,24 @@
1#!/bin/sh 1#!/bin/sh
2 2
3if [ -e /proc/hal/model ]; then 3permin ()
4 [ -e /dev/sound/dsp ] && chown root /dev/sound/dsp 4{
5 [ -e /dev/sound/mixer ] && chown root /dev/sound/mixer 5 if [ -e $1 ]
6 [ -e /dev/touchscreen/0 ] && chown root /dev/touchscreen/0 6 then
7 [ -e /dev/fb/0 ] && chown root /dev/fb/0 7 chown root $1
8 [ -e /dev/vc/0 ] && chown root /dev/vc/0 8 else
9 echo Warning: $1 does not exist.
10 return 1
9fi 11fi
12}
10 13
14if [ -e /proc/hal/model ]; then
15 devs = /dev/sound/dsp /dev/sound/mixer /dev/touchscreen/0 \
16 /dev/fb/0 /dev/vc/0
17else
18 devs = /dev/dsp /dev/dsp1 /dev/mixer /dev/ts /dev/fb0 \
19 /dev/sharp* /dev/collie*
20fi
11 21
22for i in $devs; do
23 permout( $i )
24done
diff --git a/share/opie-login/pre-session b/share/opie-login/pre-session
index 6bf9e4c..e147afc 100644
--- a/share/opie-login/pre-session
+++ b/share/opie-login/pre-session
@@ -10,47 +10,32 @@ USER=$1
10 #devices exclusive by 1) changing device ownership 10 #devices exclusive by 1) changing device ownership
11 #to the user, and 2) removing group access. 11 #to the user, and 2) removing group access.
12# 12#
13 #A better implementation would probably be to store 13 #A better implementation would probably be to store
14 #existing device permissions at load time, and restore 14 #existing device permissions at load time, and restore
15 #them at exit, rather than making assumptions about 15 #them at exit, rather than making assumptions about
16 #user/group ownership, or permissions. 16 #user/group ownership, or permissions.
17 17
18permin () 18permin ()
19{ 19{
20 if [ -e $1 ] 20 if [ -e $1 ]
21 then 21 then
22
23 chown $USER $1 22 chown $USER $1
24 chmod g-rw $1
25
26 else 23 else
24 echo Warning: $1 does not exist.
27 return 1 25 return 1
28 fi 26 fi
29} 27}
30 28
31permout ()
32{
33 [ -e $1 ]&& chown root $1
34 [ -e $1 ]&& chmod g+rw $1
35}
36
37if [ -e /proc/hal/model ]; then 29if [ -e /proc/hal/model ]; then
38
39 # fix for misconfigured devfsd 30 # fix for misconfigured devfsd
40 chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc 31 chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc
41 32 devs = /dev/sound/dsp /dev/sound/mixer /dev/touchscreen/0 \
42 [ -e /dev/sound/dsp ] && chown $USER /dev/sound/dsp 33 /dev/fb/0 /dev/vc/0
43 [ -e /dev/sound/mixer ] && chown $USER /dev/sound/mixer
44 [ -e /dev/touchscreen/0 ] && chown $USER /dev/touchscreen/0
45 [ -e /dev/fb/0 ] && chown $USER /dev/fb/0
46 [ -e /dev/vc/0 ] && chown $USER /dev/vc/0
47
48else 34else
35 devs = /dev/dsp /dev/dsp1 /dev/mixer /dev/ts /dev/fb0 \
36 /dev/sharp* /dev/collie*
37fi
49 38
50 for dev in /dev/dsp /dev/dsp1 /dev/mixer \ 39for i in $devs; do
51 /dev/ts /dev/fb0 40 permin( $i )
52 do
53 permin( $dev )
54 done 41 done
55
56fi