-
Notifications
You must be signed in to change notification settings - Fork 47
/
S02defaultdata
executable file
·53 lines (42 loc) · 984 Bytes
/
S02defaultdata
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
46
47
48
49
50
51
52
53
#!/bin/bash
test -n "${OS_VERSION}" || source /etc/init.d/base
set_empty_root_passwd() {
msg_begin "Setting empty root password"
PASSWORD="" adminpasswd
sync
msg_done
}
copy_version() {
msg_begin "Copying version file"
cp /etc/version /data/etc/version
sync
msg_done
}
set_utc_timezone() {
msg_begin "Setting UTC timezone"
ln -s /usr/share/zoneinfo/UTC /data/etc/localtime
touch /data/etc/adjtime
sync
msg_done
}
copy_data_overlay() {
msg_begin "Copying data overlay"
cp -pr /usr/share/dataoverlay/* /data
sync
msg_done
}
case "$1" in
start)
test -s /data/etc/shadow || set_empty_root_passwd
test -s /data/etc/version || copy_version
test -s /data/etc/localtime || set_utc_timezone
test -n "$(ls -A /usr/share/dataoverlay 2>/dev/null)" && copy_data_overlay
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit 0