Auto-mounting OS 7 and OS 8 disks on OS neXt
Auto-mounting OS 7 and OS 8 disks on OS neXt
- Subject: Auto-mounting OS 7 and OS 8 disks on OS neXt
- From: Doug McNutt <email@hidden>
- Date: Sun, 27 Apr 2003 11:28:15 -0600
At 22:53 -0400 4/26/03, Deivy Petrescu wrote:
>
I can only mount X on 8.6 , not the other way around.
>
Could not find any way around it.
Applescript has been very helpful in automatically mounting a bunch of disks for me. This script has been in my startup at login list since Jaguar was released and has been flawless. The main server is an SE/30 running OS 7.5.3.
It's also possible to rename MountEm to MountEm.command and execute it directly from the startup items but that leaves the Terminal app in a peculiar state in which it requires attention by the user. Applescript removes that problem.
Also, by using the mount_afp command I avoid the ubiquitous keychain which gets in the way of other attempts to mount older system disks.
This is being sent in format-flowed. Watch out for line ends inserted by email software. Also the shell scripts need to have UNIX line ends to work properly. The executable bit needs to be set using
chmod 770 MountEm
or something equivalent so that AppleScript will use the tcsh shell. If you need a binary ask.
****** The AppleScript (At least it makes it a bit on-topic.)
tell application "Finder"
do shell script "/Users/doug/bin/MountEm"
end tell
****** file ~/bin/MountEm
#!/bin/tcsh
f ($?SHELLOG) then
set thelog = $SHELLOG
else
set thelog = /dev/null
endif
echo "* Entering MountEm" >> $thelog
date >> $thelog
source $HOME/bin/SuntideMounter Mimas
source $HOME/bin/SuntideMounter Enceladus
source $HOME/bin/SuntideMounter Rhea
source $HOME/bin/SuntideMounter Iapetus
source $HOME/bin/SuntideMounter Hyperion
source $HOME/bin/SuntideMounter Deimos Mars
# This if .command is added to force execution in Terminal
# osascript -e 'tell Application "Terminal" to quit'
echo "* Leaving MountEm" >> $thelog
exit
****** file ~/bin/SuntideMounter
#!/bin/tcsh
if ($#argv < 1) then
echo "### Usage, $0 diskName [AFPserverName [password]]"
exit
endif
if ($?SHELLOG) then
set the_log = $SHELLOG
else
set the_log = /dev/null
endif
set proot = $HOST:r # Earth.local
set myself = $proot:r # Earth
# myself is the name of the machine we're working on.
# Here we will be using it as the username for the external servers.
set theName = $argv[1]
if ($#argv > 1) then
set theMachine = $argv[2]
else
set theMachine = Saturn
# Doug's file server default, an SE/30 running 7.5.3
# Replace it with your own
endif
if ($#argv > 2) then
set thePwd = $argv[3]
else
set thePwd = $myself
# Doug's passwords are the name of the requesting machine
# Replace it with your own default
endif
pushd /Volumes > /dev/null
if (-e $theName) then
echo "skipping "$theName # It's already mounted
else
mkdir $theName
mount_afp afp:/at/${myself}:${thePwd}@${theMachine}/${theName} /Volumes/$theName > /dev/null
if ($? == 0) then
echo "mounting "$theName >> $the_log
else
rmdir $theName
echo "problem mounting $theName" >> $the_log
endif
endif
popd > /dev/null
exit
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.