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

Last change on this file since 47554 was 46274, checked in by obi, 3 years ago

update lost files with install echo

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