source: ipk/source.sh4/network_samba/CONTROL/postinst @ 38192

Last change on this file since 38192 was 38192, checked in by Stephan, 4 years ago

get rid of secrets.tdb error on sh4

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