File: smbsh.in

package info (click to toggle)
samba-doc-ja 2.2.8a%2Bja1.0-0.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 34,192 kB
  • ctags: 22,693
  • sloc: ansic: 197,587; sh: 8,073; perl: 5,377; makefile: 1,489; awk: 1,146; exp: 1,143; csh: 216
file content (54 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/sh

SMBW_LIBDIR=${SMBW_LIBDIR-@builddir@/smbwrapper}

if [ ! -f ${SMBW_LIBDIR}/smbwrapper.so ]; then
    echo You need to set LIBDIR in smbsh
    exit
fi

# a simple launcher for the smbwrapper.so preloadde library

if [ x"${SMBW_USER+set}" != x"set" ]; then
    echo username?
    read user
    SMBW_USER=$user
    export SMBW_USER
fi

# this doesn't hide the password - we need a proper launch app for that
if [ x"${SMBW_PASSWORD+set}" != x"set" ]; then
    echo password?
    read pass
    SMBW_PASSWORD=$pass
    export SMBW_PASSWORD
fi

PWD=`pwd`
export PWD
PS1='smbsh$ '
export PS1


host_os=@HOST_OS@

case "$host_os" in
        *irix*)
		_RLDN32_LIST=$SMBW_LIBDIR/smbwrapper.so:DEFAULT
		_RLD_LIST=$SMBW_LIBDIR/smbwrapper.32.so:DEFAULT
		export _RLDN32_LIST
		export _RLD_LIST
		;;
	*osf*)
		_RLD_LIST=$SMBW_LIBDIR/smbwrapper.so:DEFAULT
		export _RLD_LIST
		;;	        
	*) 
		LD_PRELOAD=$SMBW_LIBDIR/smbwrapper.so
		export LD_PRELOAD
		;;
esac

echo starting smbwrapper on $host_os

exec ${SMBW_SHELL-${SHELL-/bin/sh}} ${1+"$@"}