home *** CD-ROM | disk | FTP | other *** search
- mlocal := 0;
- mhost := 1;
- msync := 2;
-
- new string str
- new string send
- new integer hvn
-
- hvn := 0;
-
- message "Checking..."
- transmit "^M"
- pause 1
- transmit "echo -\\-\\-\\-^M"
- waitfor "---", 7
- if not waitfor then
- message "Logging in..."
- execute "login.scr"
- endif
-
- message "Initializing..."
-
- transmit "^M''sh^M"
- abortrequest := 1
- pause 2
- ok := shexec("umask 000 ; PMD=${PMDIR-$HOME/.pmail}")
- if (ok != 0) then
- abort("Error initializing host");
- exit;
- endif
-
- ok := shexec("if [ -f $PMD/id.018 ] ; then _rc=ok ; else _rc=err ; fi")
-
- ok := gettext(str, "echo $_rc", 40)
- if (ok != 0) then
- abort("Error reading host return code");
- exit;
- endif
-
- if ( strstr(str,"ok") != 0 ) then
- ok := shexec("cd $PMD")
- if (ok != 0) then
- abort("Error changing to pmail directory");
- exit;
- endif
- else
- message "Placing files on host..."
- ok := shexec("if [ ! -d $PMD ] ; then mkdir $PMD ; fi")
- if (ok != 0) then
- abort("Error creating pmail directory");
- exit;
- endif
- ok := shexec("cd $PMD")
- if (ok != 0) then
- abort("Error changing to new pmail directory");
- exit;
- endif
-
- readfile("create.sh", str)
- ok := puttext(str, "cat > create.sh", 100)
- if (ok != 0) then
- abort("Error putting create.sh");
- exit;
- endif
-
- ok := shexec("sh create.sh")
- if (ok != 0) then
- abort("Error executing create.sh");
- exit;
- endif
- endif
-
- if (dofolders != 0) then
- strcpy(send, "PMF=${PMFOLDERS-")
- strcat(send, folders)
- strcat(send, "} ")
- ok := shexec(send)
- if (ok != 0) then
- abort("Error setting folders directory");
- exit;
- endif
- endif
-
- if (dodownloadaliases != 0) then
- execute "alias.sys";
- endif
-
- if (doupdate != 0) then
- execute "get.sys";
- endif
-
- if (dosendnewmail != 0) then
- execute "send.sys";
- endif
-
- if ((doupdatefolders != 0) or (dosyncfolders != 0)) then
- execute "folders.sys";
- endif
- transmit "^M^D^M"
- execute "logout.sys"
- exit
-