@@ -5,12 +5,11 @@ package main
55import (
66 "flag"
77 "fmt"
8+ "log"
89 "os"
910 "os/signal"
1011 "strconv"
1112 "time"
12-
13- "github.com/iamthemuffinman/logsip"
1413)
1514
1615var (
@@ -32,11 +31,10 @@ func main() {
3231 fmt .Println (version )
3332 os .Exit (0 )
3433 }
35- log := logsip .Default ()
36-
3734 if * token == "" {
3835 log .Fatalln ("-token required" )
3936 }
37+
4038 if * keyID == "" {
4139 log .Fatalln ("-key required" )
4240 }
@@ -49,45 +47,45 @@ func main() {
4947 if err != nil {
5048 log .Fatalf ("There was an error creating the droplets:\n Error: %s\n " , err .Error ())
5149 }
52- log .Infoln ("Droplets deployed. Waiting 100 seconds..." )
50+ log .Println ("Droplets deployed. Waiting 100 seconds..." )
5351 time .Sleep (100 * time .Second )
5452
5553 // For each droplet, poll it once, start SSH proxy, and then track it.
5654 machines := dropletsToMachines (droplets )
5755 for i := range machines {
5856 m := & machines [i ]
5957 if err := m .GetIPs (client ); err != nil {
60- log .Warnf ("There was an error getting the IPv4 address of droplet name: %s\n Error: %s\n " , m .Name , err .Error ())
58+ log .Println ("There was an error getting the IPv4 address of droplet name: %s\n Error: %s\n " , m .Name , err .Error ())
6159 }
6260 if m .IsReady () {
6361 if err := m .StartSSHProxy (strconv .Itoa (* startPort ), * sshLocation ); err != nil {
64- log .Warnf ("Could not start SSH proxy on droplet name: %s\n Error: %s\n " , m .Name , err .Error ())
62+ log .Println ("Could not start SSH proxy on droplet name: %s\n Error: %s\n " , m .Name , err .Error ())
6563 } else {
66- log .Infof ("SSH proxy started on port %d on droplet name: %s IP: %s\n " , * startPort , m .Name , m .IPv4 )
64+ log .Println ("SSH proxy started on port %d on droplet name: %s IP: %s\n " , * startPort , m .Name , m .IPv4 )
6765 go m .PrintStdError ()
6866 }
6967 * startPort ++
7068 } else {
71- log .Warnf ("Droplet name: %s is not ready yet. Skipping...\n " , m .Name )
69+ log .Println ("Droplet name: %s is not ready yet. Skipping...\n " , m .Name )
7270 }
7371 }
7472
75- log .Infoln ("proxychains config" )
73+ log .Println ("proxychains config" )
7674 printProxyChains (machines )
77- log .Infoln ("socksd config" )
75+ log .Println ("socksd config" )
7876 printSocksd (machines )
7977
80- log .Infoln ("Please CTRL-C to destroy droplets" )
78+ log .Println ("Please CTRL-C to destroy droplets" )
8179
8280 // Catch CTRL-C and delete droplets.
8381 c := make (chan os.Signal , 1 )
8482 signal .Notify (c , os .Interrupt )
8583 <- c
8684 for _ , m := range machines {
8785 if err := m .Destroy (client ); err != nil {
88- log .Warnf ("Could not delete droplet name: %s\n " , m .Name )
86+ log .Println ("Could not delete droplet name: %s\n " , m .Name )
8987 } else {
90- log .Infof ("Deleted droplet name: %s" , m .Name )
88+ log .Println ("Deleted droplet name: %s" , m .Name )
9189 }
9290 }
9391}
0 commit comments