| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | echo Use Install Dest: $1
|
|---|
| 4 | echo Start Install Script: $0
|
|---|
| 5 |
|
|---|
| 6 | INSTDIR="$1"
|
|---|
| 7 |
|
|---|
| 8 | echo INSTDIR: $INSTDIR
|
|---|
| 9 | export PATH=$PATH:/var/swap/bin:/mnt/swapextensions/bin:/var/bin
|
|---|
| 10 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/var/swap/lib:/mnt/swapextensions/lib:/var/lib
|
|---|
| 11 |
|
|---|
| 12 | if [ -f /mnt/config/start-config ]; then
|
|---|
| 13 | echo "enable samba autostart on /mnt/config/start-config"
|
|---|
| 14 | sed s#"sambaserver=n"#"sambaserver=y"#g -i /mnt/config/start-config
|
|---|
| 15 | fi
|
|---|
| 16 |
|
|---|
| 17 | echo "if not exist, use restore smb.conf"
|
|---|
| 18 | if [ ! -e /mnt/config/smb.conf ]; then
|
|---|
| 19 | cp /etc/titan.restore/mnt/config/smb.conf /mnt/config/smb.conf
|
|---|
| 20 | fi
|
|---|
| 21 |
|
|---|
| 22 | echo "check if smbpasswd exists"
|
|---|
| 23 | if [ ! -e $INSTDIR/etc/samba/private/smbpasswd ]; then
|
|---|
| 24 | touch $INSTDIR/etc/samba/private/smbpasswd
|
|---|
| 25 | fi
|
|---|
| 26 |
|
|---|
| 27 | echo "check if secrets.tdb exists"
|
|---|
| 28 | if [ ! -e $INSTDIR/etc/samba/private/secrets.tdb ]; then
|
|---|
| 29 | touch $INSTDIR/etc/samba/private/secrets.tdb
|
|---|
| 30 | fi
|
|---|
| 31 |
|
|---|
| 32 | echo "update smb.conf"
|
|---|
| 33 | sed "s!private dir = .*!private dir = $INSTDIR/etc/samba/private!" -i /mnt/config/smb.conf
|
|---|
| 34 | sed "s!smb passwd file = .*!smb passwd file = $INSTDIR/etc/samba/private/smbpasswd!" -i /mnt/config/smb.conf
|
|---|
| 35 |
|
|---|
| 36 | echo "start samba"
|
|---|
| 37 | smbd -D -s /mnt/config/smb.conf
|
|---|
| 38 | sleep 1
|
|---|
| 39 | nmbd -D -s /mnt/config/smb.conf
|
|---|
| 40 |
|
|---|
| 41 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.