mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-09 21:53:47 -05:00
added password prompt for AFP mount
This commit is contained in:
@@ -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"
|
||||||
@@ -305,12 +314,12 @@ function mainScript() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$USEPROFILE" != "true"]; then
|
if [ "$USEPROFILE" != "true" ]; then
|
||||||
# Run Unison without a profile
|
# Run Unison without a profile
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user