I have a bash script that mounts a number of samba shares, but one particular mount command makes it hang. Strangely, the same command works when executed directly from the command line:
Code:
sudo mount -t cifs //name-of-share /media/FTPpublic -o username=myname
asks for the password and then mounts the share as expected.
In the script, I have the line:
Code:
sudo mount -t cifs //name-of-share /media/FTPpublic -o username=$usn,password=$usp
where usn and usp are user name and password entered earlier. This works for all other mount commands in the script, but wherever I put the line with this particular share, it just hangs at this point.
Hi,
For my bash script, terminal with bash is generate an OK output and program works right.
already,
terminal with ash have "line 48: syntax error: Bad substitution" output and program don't work.
:confused: (0 Replies)
In all of my brief and superficial experience with Unix or Linux, the one curious and consistent thing has been that 'cd ./' (back up one directory level) has done absolutely nothing in any of them. Now I understand that, at least for bash, 'cd ./' appears to have been substituted by 'cd ..'
Am... (1 Reply)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hello everyone,
I am having problems figuring this out.
This script below is supposed to create a list of file names with their "md5sum", in a file "lib-list.txt"
When I run it "sh component-list.sh " I get this:component-list.sh: 4: component-list.sh: function: not found
component-list.sh:... (4 Replies)
Hi All,
I'm completely new to bash scripting and still learning my way through albeit vey slowly.
I need to know where to insert my server names', my ip address numbers through out the script alas to no avail.
I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Hello, :)
I've an issue with the creation of a directory, All work without it :mad: So, below, my scripts with the debug output :
#!/bin/bash
# PATHS
HOME_BACKUP="/home/backup"
HOME_SCRIPT="/home/scripts/test/backup_server"
TARGET="/var/www"
# DATE
DATE_Ymd=$(date +%Y-%m-%d)
#... (1 Reply)
I've found this script part on the stackoverflow:
if ; then
sudo bash "$0" "$@";
exit "$?";
fi
I realized that sudo bash "$0" "$@"; is the only needed for me.
But the strange thing happens when I move this line outside the IF statement:
sudo bash "$0" "$@"; stops the... (9 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT OPENDARWIN
mount_smbfs
MOUNT_SMBFS(8) BSD System Manager's Manual MOUNT_SMBFS(8)NAME
mount_smbfs -- mounts a shared resource from an SMB file server
SYNOPSIS
mount_smbfs [-I host] [-M cmode[/smode]] [-N] [-O cowner[:cgroup]/sowner[:sgroup]] [-R retrycount] [-T timeout] [-U user] [-W workgroup]
[-d mode] [-f mode] [-g gid] [-h] [-n opt] [-u uid] //[workgroup;][user[password]@] server[/share] path
DESCRIPTION
The mount_smbfs command mounts a share from a remote server using SMB/CIFS protocol.
The options are:
-I host
Do not use NetBIOS name resolver and connect directly to host, which can be either a valid DNS name or an IP address.
-M cmode[/smode]
Assign access rights to the newly created connection.
-N Do not ask for a password. At run time, mount_smbfs reads the ~/.nsmbrc file for additional configuration parameters and a password.
If no password is found the mount_smbfs prompts for it.
-O cowner[:cgroup]/sowner[:sgroup]
Assign owner/group attributes to the newly created connection.
-R retrycount
How many retries should be done before the SMB requester decides to drop the connection.
-T timeout
Timeout in seconds for each request.
-U user
Specifies the user name to be used in the authentication request.
-W workgroup
Specifies the workgroup to be used in the authentication request.
-f mode, -d mode
Specify permissions that should be assigned to files and directories. The values must be specified as octal numbers. Default value
for the file mode is taken from mount point, default value for the dir mode adds execute permission where the file mode gives read
permission.
Note that these permissions can differ from the rights granted by SMB server.
-h Prints a help message, much like the SYNOPSIS above.
-n opt Set opt option to affect file name lookups. opt can be one of the following:
Value Meaning
long No long names. Server supports only "8.3" format.
-u uid, -g gid
User id and group id assigned to files. The default is owner and group id from directory where the volume is mounted.
//[workgroup;][user[password]@] server[/share]
The mount_smbfs command will use server as the NetBIOS name of remote computer, user as the remote user name and share as the
resource name on a remote server. Workgroup and/or password may be specified here. If user is omitted the logged in user id will be
used. Omitting share is an error when mount_smbfs is run from the command line, otherwise a browsing dialogue is presented.
path Path to mount point.
FILES
~/.nsmbrc Keeps static parameters for connections and other information. See ./examples/dot.nsmbrc for details.
EXAMPLES
The following illustrate how to connect to an SMB server SAMBA as user GUEST to mount PUBLIC:
mount_smbfs -I samba.mydomain.com //guest@samba/public /smb/public
BUGS
Please report bugs to Apple.
AUTHORS
Boris Popov <bp@butya.kz>, <bp@freebsd.org>
FreeBSD Mar 10, 2000 FreeBSD