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

Last change on this file since 45683 was 45683, checked in by obi, 4 years ago

fix plugin permtime

File size: 1.1 KB
RevLine 
[13993]1#!/bin/sh
[23439]2INSTDIR="$1"
[13993]3
[33570]4echo INSTDIR: $INSTDIR
[33574]5export PATH=$PATH:/var/swap/bin:/mnt/swapextensions/bin:/var/bin
[33703]6export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/var/swap/lib:/mnt/swapextensions/lib:/var/lib
[33570]7
[45683]8if [ -e /etc/.oebuild ] || [ -e /etc/.ovbuild ];then
[33574]9 echo "enable samba autostart on /mnt/config/start-config"
10 sed s#"sambaserver=n"#"sambaserver=y"#g -i /mnt/config/start-config
[24435]11fi
12
[33712]13echo "if not exist, use restore smb.conf"
[45683]14if [ -e /etc/.oebuild ] || [ -e /etc/.ovbuild ];then
[33712]15 cp /etc/titan.restore/mnt/config/smb.conf /mnt/config/smb.conf
[33573]16fi
[33566]17
[33712]18echo "check if smbpasswd exists"
[45683]19if [ -e /etc/.oebuild ] || [ -e /etc/.ovbuild ];then
[33713]20 touch $INSTDIR/etc/samba/private/smbpasswd
[33712]21fi
[24435]22
[38192]23echo "check if secrets.tdb exists"
[45683]24if [ -e /etc/.oebuild ] || [ -e /etc/.ovbuild ];then
[38192]25 touch $INSTDIR/etc/samba/private/secrets.tdb
26fi
27
[33706]28echo "update smb.conf"
[33707]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
[33706]31
[33577]32echo "start samba"
[33576]33smbd -D -s /mnt/config/smb.conf
34sleep 1
35nmbd -D -s /mnt/config/smb.conf
[33574]36
[24435]37exit 0
Note: See TracBrowser for help on using the repository browser.