-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptware.startup
executable file
·45 lines (34 loc) · 1.03 KB
/
optware.startup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
logger "Initializing optware.startup"
unset LD_LIBRARY_PATH
unset LD_PRELOAD
unset OPT_PROFILE
unset OPT_ROOT
OPT_PROFILE=0
OPT_ROOT=0
for mount in `df -h | awk 'BEGIN { FS =" " } ; { print $6 }'`
do
if [ "$mount" == "/rom/etc/profile" ]; then
OPT_PROFILE=1
logger OPT_PROFILE = $OPT_PROFILE
fi
if [ "$mount" == "/tmp/home/root" ]; then
OPT_ROOT=1
logger OPT_ROOT = $OPT_ROOT
fi
done
[ ! -d /opt/home/root ] && mkdir -p /opt/home/root
if [ -e /opt/etc/profile ] && [ $OPT_PROFILE == 0 ]; then
mount -o bind /opt/etc/profile /etc/profile
fi
[ -e /tmp/home/root/.ssh/authorized_keys ] && cp /tmp/home/root/.ssh/authorized_keys /tmp
if [ -d /opt/home/root ] && [ $OPT_ROOT == 0 ]; then
mount -o bind /opt/home/root /tmp/home/root
fi
[ ! -d /opt/home/root/.ssh ] && mkdir -p /opt/home/root/.ssh
[ -e /tmp/authorized_keys ] && mv /tmp/authorized_keys /opt/home/root/.ssh/
if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
[ -x $f ] && $f start
done
fi