; Installation script for AmiPhone ; by Jeremy Friesner (transcript "On installing AmiPhone...") (if (exists "AmiTCP:" (noreq)) ( ; if AmiPhoned is already in /serv, probably they've already installed before (set DefaultUpdate (exists "amitcp:serv/AmiPhoned" (noreq))) ; don't want to make a distinction between 1 and 2 (if (> DefaultUpdate 0) (set DefaultUpdate 1)) (set PhoneUpdate (askchoice (prompt "Select which kind of install you want:") (choices "First Time Install" "Update") (default DefaultUpdate) (help "If you've never installed AmiPhone on your system before, select First Time Install. If you already have an earlier version, select Update") )) (set PhoneDir (askdir (prompt "What directory would you like to put the AmiPhone executable in?") (help @askdir-help) (default "AmiTCP:bin") ) ) ; if PhoneDir isn't the usual, set the AMIPHONE env: var to let AmiPhoned know (if (not (PatMatch "Amitcp:bin" PhoneDir)) ( (set EnvCommand (cat "echo " (tackon PhoneDir "AmiPhone") " >env:AMIPHONE")) (run EnvCommand) (set EnvCommand (cat "echo " (tackon PhoneDir "AmiPhone") " >envarc:AMIPHONE")) (run EnvCommand) ) ) ; Copy AmiPhone and AmiPhoned to the bin and serv directories (copyfiles (prompt (cat "Copying AmiPhone executable to " PhoneDir)) (help @copyfiles-help) (source "") (infos) (pattern "AmiPhone") (dest PhoneDir) ) (copyfiles (prompt "Copying AmiPhoned daemon to amitcp:serv") (help @copyfiles-help) (source "") (infos) (pattern "AmiPhoned") (dest "amitcp:serv") ) (run "delete t:AmiPhone.AppendMeToServices QUIET") (if (= PhoneUpdate 0) ( (textfile (prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone 2956/udp\n\nneeds to be present in your amitcp:db/services file. Do you wish me to append this line to that file?\n\n(Note: this does not check to see if the line is already in the file! If you've installed AmiPhone before, skip this part)") (help "Including this line in your amitcp:db/services file tells AmiTCP's inet daemon that all requests on port 2956 should be sent to the AmiPhoned program for further processing. If this line is not included, you will not be able to receive AmiPhone requests from other people.") (dest "t:AmiPhone.AppendMeToServices") (append "\nAmiPhone 2956/udp\n") (confirm) ) (set AddServiceString ("join amitcp:db/services t:AmiPhone.AppendMeToServices as t:AmiPhone.Temp1")) (set UpdateServiceString ("copy t:AmiPhone.Temp1 amitcp:db/services")) (if (exists "t:AmiPhone.AppendMeToServices") ((run AddServiceString) (run UpdateServiceString) (run "delete t:AmiPhone.Temp1") (run "delete t:AmiPhone.AppendMeToServices") ) ) (run "delete t:AmiPhone.AppendMeToInetD QUIET") (textfile (prompt "\nAlso, the line:\n\nAmiPhone dgram udp wait root amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file. Do you wish me to append this line to that file?\n(Note: this does not check to see if the line is already in the file! If you've installed AmiPhone before, skip this part)") (help "Including this line in your amitcp:db/inetd.conf file tells AmiTCP what program to run whenever it gets an AmiPhone request. It is important that the file path and name in this line reflect the location of the AmiPhoned executable.") (dest "t:AmiPhone.AppendMeToInetD") (append "\nAmiPhone dgram udp wait root amitcp:serv/AmiPhoned") (confirm) ) (set AddInetString ("join amitcp:db/inetd.conf t:AmiPhone.AppendMeToInetD as t:AmiPhone.Temp2")) (set UpdateInetString ("copy t:AmiPhone.Temp2 amitcp:db/inetd.conf")) (if (exists "t:AmiPhone.AppendMeToInetD") ((run AddInetString) (run UpdateInetString) (run "delete t:AmiPhone.Temp2") (run "delete t:AmiPhone.AppendMeToInetD") ) ) ) ) ;;;;end if Update=0 (message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!") ) (abort "\n\nAmiTCP does not appear to be set up on your system. (Specifically, the assign AmiTCP: has not been made) Because of this, I am unable to install AmiPhone. Please install AmiTCP and then try again.") )