home *** CD-ROM | disk | FTP | other *** search
- *
- * REMOTE.CMD
- *
- * Command File to do Remote System Access
- * This is a sample PereLine Script that poses as a Remote Dial Up.
- * While this is running users can dial into your system and they
- * will be required to enter a login ID and Password.
- * They will also have to enter commands via a menu interface.
- *
- * Note: This whole file will execute somewhat faster if you remove
- * some of these explanatory notes.
-
- Define LAST_ON VT_AVAIL VT_SHORT VT_LONG
-
- If Exist &SYSTEM\VHOST.EXE
- Assign VT_AVAIL 1
- Assign VT_SHORT ", Vterm"
- Assign VT_LONG "Vterm Virtual Terminal Option Vterm [FileName.EXE Arg1 ... Arg0]"
- Else
- Assign VT_AVAIL 0
- Assign VT_SHORT ""
- Assign VT_LONG ""
- EndIf
-
- Get Global
- OnError Goto GetUser
- Goto Start
-
- * Exiting Because Operator Pressed Esc
- :Exit
- OnError Ignore
- Set Global
- Message Operator Canceled - Exiting ...
- If Not "&ISCONNECT"
- Phone Answer 0
- EndIf
- Clear
- Exit OK
-
- * Get out of here (I mean it !)
- :.G
- * Perform Quit
- Perform Quit
- Goto Start
-
- * Virtual Terminal
- :.V
- If &VT_AVAIL = 1
- Vhost &2 &3 &4 &5 &6 &7
- FlushBuf
- EndIf
- Goto GetInput
-
- * Send Help to the User
- :.H
-
- Transmit
- ╔═[ PereLine Remote Help ]════════════════════════════════════════════════╗
- ║ You must enter a complete PereLine Command to execute from the remote. ║
- ║ Enter Help for a List of Valid Commands. ║
- ║ Enter the Command Goodbye when you are through. ║
- ╚═════════════════════════════════════════════════════════════════════════╝
- Command Description Execution
- ═══════════════════════════════════════════════════════════════════════════
- Access Access [Parms or Files] Access Parms or Access Files
- Change Change Parameters Change OPtion Parameter
- Goodbye Hang up the Phone Goodbye
- Help Display this Help Message Help
- Message Leave a message Message
- Protocol Change the Current Protocol Protocol [Type]
- Receive Transfer file from YOU to US Receive [FileName if Not Batch]
- Send Transfer file from US to YOU Send FileName ...
- Talk Talk with Remote Operator Talk
- &VT_LONG
- EndTransmit
-
- Goto GetInput
-
- * Let them enter a message for the Remote Operator
- :.M
- Execute Message
- '
- Goto GetInput
-
- * Set the Protocol
- :.P
- Save 9
- Args &0
- Restore 9
- If Not "&2"
- Transmit
- What Protocol?
- ASC) ASCII (XON/XOFF)
- XMD) XMODEM
- XMC) XMODEM Checksum
- XMB) XMODEM Batch
- TEL) Telink
- YMD) YMODEM
- YMB) YMODEM Batch
- YMG) YMODEM-G
- KER) Kermit
- ZMD) ZMODEM (DSZ)
- EndTransmit
- Enter Remote 2 Which?
- EndIf
- If "&2"
- If Not Change TRansfer &2
- Transmit
- Protocols have to be one of the three character choices from the list.
- EndTransmit
- EndIf
- EndIf
- Goto GetInput
-
- * Receive a File
- :.R
- Args &0
- If Not "&ISBATCH"
- If Not "&2"
- '
- Enter Remote 2 Receive File Name?
- EndIf
- '
- 'Ready to Receive using &PROTOCOL
- '
- ' On YOUR System:
- ' Press [ALT+S] and SELECT &PROTOCOL
- ' then
- ' Select the file you want to SEND to US
- Perform Receive &2
- Else
- '
- 'Ready to Receive using &PROTOCOL
- '
- ' On YOUR System:
- ' Press [ALT+S] and SELECT &PROTOCOL
- ' then
- ' Select the file you want to SEND to US
- Perform Receive
- EndIf
- WaitFor Delay 2
- WaitFor Transfer
- WaitFor Delay 2
- FlushBuf
- Goto GetInput
-
- * Send a File
- :.S
- Args &0
- If Not "&2"
- '
- Enter Remote 2 Send File Name?
- EndIf
- '
- 'Ready to Send using &PROTOCOL
- '
- If "&ISBATCH"
- ' On YOUR System:
- ' Press [ALT+R] and SELECT &PROTOCOL
- Else
- ' On YOUR System:
- ' Press [ALT+R] and SELECT &PROTOCOL
- ' then
- 'Select the NAME you want to call the file on YOUR system
- EndIf
- Perform Send &2 &3 &4 &5 &6 &7 &8 &9
- WaitFor Transfer
- Goto GetInput
-
- * See if the Remote Operator Wants to Talk
- :.T
- OnError Goto NoTalk
-
- Transmit
-
- Trying to Find the Remote Operator Please Wait (Press [Esc] to Abort ) ...
- EndTransmit
- Talk Page
- Transmit
-
- Returning to Command Menu ...
-
- EndTransmit
- Goto GetInput
-
- * Nobody There or Aborted ...
- :NoTalk
- Transmit
-
- Remote Operator is Not Responding ...
-
- EndTransmit
- Goto GetInput
-
- * Lost Connection
- * Restore Parameters and Go back and Wait
- :Done
- OnError Ignore
- Set
- Message Connection Lost ...
-
- :Start
- Clear
- Display
-
-
- ══════════════════════════════════════════════════════════════════════════
-
- ^RPereLine Remote Mode^N waiting for caller at Speed: &BAUD
-
- If you want to cancel Remote Mode press the ^R[Esc]^N key.
-
- Status:
- EndDisplay
-
- If Exist \PL\MSG\SYSOP.MSG
- Display \ ^BMail Waiting ...
- Else
- Display \ No Mail Waiting ...
- Endif
-
- If "&LAST_ON"
- Display \ Last User Was: ^R&LAST_ON
- Else
- Display \ No One Has Called Yet ...
- EndIf
-
- Display
-
-
- ══════════════════════════════════════════════════════════════════════════
- EndDisplay
-
- * Wait for a Connection
- :GetUser
-
- * Just a few little changes ... Couldn't hurt right?
- Change ALine Local ECho Local MAsk Off EMulate TTY
- Change ENter ^M NLine ^D CHar 0 REturn 0 TImer 20
- Get
- If Not "&ISCONNECT"
- Phone HangUp
- Phone Answer ON
- EndIf
-
- OnError Goto Exit
- FlushBuf
- WaitFor Connection
- Clear
- * Got one ...
- * Find out who they are
- Change ALine Both
- Change ECho Both
-
- OnError Goto Done
- FlushBuf
- SignOn
- FlushBuf
-
- * Say Hello to the nice person ...
- Transmit
-
- Welcome -- &USER --
- Today Is: &DATE &TIME
- Current File Transfer Protocol: &PROTOCOL
- Security Set To: &XTERNAL
-
- Checking for Messages ... Please Wait ...
-
- EndTransmit
-
- OnError Goto GetInput
- * Any Message Files ???
- If Exist \PL\MSG\MESSAGE
- 'To Control the Display of Messages
- 'Enter [Ctrl+S] to Stop, [Ctrl+Q] to Start again, and [Ctrl+X] to Abort
- '
- Execute Type \PL\MSG\MESSAGE
- Anykey Remote Press Any Key to Continue ...
- '
- EndIf
-
- If Exist \PL\MSG\\&USER.MSG
- 'To Control the Display of Messages
- 'Enter [Ctrl+S] to Stop, [Ctrl+Q] to Start again, and [Ctrl+X] to Abort
- '
- Execute Type \PL\MSG\\&USER.MSG
- '
- Anykey Remote Want to Delete the Messages? (y/N)
- '
- If Key Y
- DEL \PL\MSG\\&USER.MSG
- '
- 'Messages for &USER Deleted ...
- '
- EndIf
- EndIf
-
- * Sounds bad I know, but what are you gonna do?
- Goto .H
- *Skip to the Get User Stuff
- Goto GetUser
-
- * --------------------------------------------------------------------------
- * Interactive Stuff (Remote User can Enter Commands)
- * First Check To see if there is a connection still.
- * Then prompt the remote user and get a command.
- :GetInput
- OnError Goto GetInput
- * Save the name of the last user
- If Not "&ISCONNECT"
- Goto Done
- EndIf
-
- Assign LAST_ON &USER at &TIME &DATE
-
- Transmit
-
- User (&USER) Security (&XTERNAL)
- Current Protocol: &PROTOCOL
- Current Directory: &DIRECTORY
-
- EndTransmit
-
- If &VT_AVAIL = 1
- Transmit
- Access, Change, Help, Goodbye, Message, Protocol, Receive, Send, Talk&VT_SHORT
- EndTransmit
- Else
- Transmit
- Access, Change, Help, Goodbye, Message, Protocol, Receive, Send, Talk
- EndTransmit
- EndIf
-
- Enter Remote 0 Command?
-
- * The following will find the label starting from the top of the
- * Command File. Let's only look at the first character.
- Assign 1 &LEFT(1 &0)
- Goto .&1
-
- * If the .&1 Label was not found fall thru and
- * try to execute the string.
- :.&1
- Perform &0
- Goto GetInput
-
-