data-skeleton.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. cd /data
  3. /bin/rm -rf *
  4. /bin/mkdir -p -m 0777 public tmp
  5. /bin/mkdir -p -m 0755 app appinfo etc opt
  6. /bin/mkdir -p -m 0750 property
  7. /bin/mkdir -p -m 0700 security
  8. /bin/mkdir -p -m 0775 etc/ts var/opt
  9. # chown
  10. /bin/chown 1:1 etc/ts
  11. /bin/chown 999:999 opt appinfo var/opt
  12. /bin/chown 0:0 security
  13. /bin/cat << EOD > /data/etc/group
  14. root:x:0:
  15. system:x:1:MAINAPP
  16. hwdev:x:2:system,SUBAPP,MAINAPP
  17. ped:x:3:
  18. nobody:x:900:
  19. SUBAPP:x:998:
  20. MAINAPP:x:999:
  21. EOD
  22. /bin/chmod 0644 /data/etc/group
  23. /bin/cat << EOD > /data/etc/passwd
  24. root:x:0:0:root:/root:/bin/sh
  25. system:x:1:1:administrator:/:/bin/false
  26. hwdev:x:2:2:hardware access:/bin:/bin/false
  27. ped:x:3:3:ped:/:/bin/false
  28. nobody:x:900:900:nobody:/:/bin/false
  29. SUBAPP:x:998:998:SUBAPP user:/:/bin/false
  30. MAINAPP:x:999:999:MAINAPP user:/:/bin/sh
  31. EOD
  32. /bin/chmod 0644 /data/etc/passwd
  33. /bin/cat << EOD > /data/etc/shadow
  34. root:$1$9vCTc/8H$lRt/1/QoEXNamPGzhVGar/:0:0:99999:7:::
  35. system:!$1$phzwtsL4$Qso0Z3H5eqoSUXwQ/hEAV1:0:0:99999:7:::
  36. hwdev:!$1$jDG2WeUj$uM3mIyvZ1rkd11J7izXt6.:0:0:99999:7:::
  37. ped:!$1$ZMsJtrjO$ibuMCiJvuyxQnrpkdptup/:0:0:99999:7:::
  38. SUBAPP:!$1$gJUpez2c$U0Qv9IyoUAgD5cTSumbKB0:0:0:99999:7:::
  39. MAINAPP:$1$wsdZqcgf$zD5mTBbZs.olBn7f02Wgf.:0:0:99999:7:::
  40. EOD
  41. /bin/chmod 0640 /data/etc/shadow
  42. /bin/cat << EOD > /data/etc/ts/ts.conf
  43. module_raw input
  44. module pthres pmin=1
  45. module variance delta=30
  46. module dejitter delta=100
  47. module linear
  48. EOD
  49. /bin/chmod 0644 /data/etc/ts/ts.conf
  50. /bin/touch /data/.ready
  51. /bin/sync