added password prompt for AFP mount

This commit is contained in:
Nathaniel Landau
2015-01-02 23:10:33 -05:00
parent 41e524870d
commit 199f735a5f

View File

@@ -138,6 +138,8 @@ NEEDMOUNT="false"
# MOUNTPOINT is the address of the drive to be mounted. # MOUNTPOINT is the address of the drive to be mounted.
# Use the format afp://username:password@address/mountname # Use the format afp://username:password@address/mountname
# to be prompted to enter a password, change MOUNTPW to 'true'
MOUTPW="false"
MOUNTPOINT="" MOUNTPOINT=""
# REMOTEVOLUME is the directory that the drive should be mounted # REMOTEVOLUME is the directory that the drive should be mounted
@@ -164,7 +166,10 @@ TARGETDIRECTORY=""
# more info: http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html # more info: http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html
# #
# If you wish to use a Unison profile change USERPROFILE to 'true' # If you wish to use a Unison profile change USERPROFILE to 'true'
# and add the profile name to UNISONPROFILE # and add the profile name to UNISONPROFILE.
#
# Note: Roots should not be included in the UNISON prf. They will be called here
# using the SOURCE/TARGET variables
USEPROFILE="false" USEPROFILE="false"
UNISONPROFILE="" UNISONPROFILE=""
@@ -241,7 +246,11 @@ function mainScript() {
if is_not_dir "$REMOTEVOLUME"; then if is_not_dir "$REMOTEVOLUME"; then
e_arrow "Mounting drive" e_arrow "Mounting drive"
mkdir "$REMOTEVOLUME" mkdir "$REMOTEVOLUME"
if [ "$MOUTPW" = "true" ]; then # if password prompt needed
mount_afp -i "$MOUNTPOINT" "$REMOTEVOLUME"
else
mount_afp "$MOUNTPOINT" "$REMOTEVOLUME" mount_afp "$MOUNTPOINT" "$REMOTEVOLUME"
fi
sleep 10 sleep 10
echo "$NOW - $REMOTEVOLUME Mounted" >> "$LOGFILE" echo "$NOW - $REMOTEVOLUME Mounted" >> "$LOGFILE"
e_success "$REMOTEVOLUME Mounted" e_success "$REMOTEVOLUME Mounted"
@@ -310,7 +319,7 @@ function mainScript() {
unison "$SOURCEDIRECTORY" "$TARGETDIRECTORY" unison "$SOURCEDIRECTORY" "$TARGETDIRECTORY"
else else
# Run unison with a profile # Run unison with a profile
unison "$UNISONPROFILE" unison "$UNISONPROFILE" "$SOURCEDIRECTORY" "$TARGETDIRECTORY"
fi fi
fi fi