Initial import
[samba] / source / smbwrapper / smbsh.in
1 #! /bin/sh
2
3 SMBW_LIBDIR=${SMBW_LIBDIR-@builddir@/smbwrapper}
4
5 if [ ! -f ${SMBW_LIBDIR}/smbwrapper.so ]; then
6     echo You need to set LIBDIR in smbsh
7     exit
8 fi
9
10 # a simple launcher for the smbwrapper.so preloadde library
11
12 if [ x"${SMBW_USER+set}" != x"set" ]; then
13     echo username?
14     read user
15     SMBW_USER=$user
16     export SMBW_USER
17 fi
18
19 # this doesn't hide the password - we need a proper launch app for that
20 if [ x"${SMBW_PASSWORD+set}" != x"set" ]; then
21     echo password?
22     read pass
23     SMBW_PASSWORD=$pass
24     export SMBW_PASSWORD
25 fi
26
27 PWD=`pwd`
28 export PWD
29 PS1='smbsh$ '
30 export PS1
31
32
33 host_os=@HOST_OS@
34
35 case "$host_os" in
36         *irix*)
37                 _RLDN32_LIST=$SMBW_LIBDIR/smbwrapper.so:DEFAULT
38                 _RLD_LIST=$SMBW_LIBDIR/smbwrapper.32.so:DEFAULT
39                 export _RLDN32_LIST
40                 export _RLD_LIST
41                 ;;
42         *osf*)
43                 _RLD_LIST=$SMBW_LIBDIR/smbwrapper.so:DEFAULT
44                 export _RLD_LIST
45                 ;;              
46         *) 
47                 LD_PRELOAD=$SMBW_LIBDIR/smbwrapper.so
48                 export LD_PRELOAD
49                 ;;
50 esac
51
52 echo starting smbwrapper on $host_os
53
54 exec ${SMBW_SHELL-${SHELL-/bin/sh}} ${1+"$@"}