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