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

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

update lost files with install echo

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