diff --git a/src/rhosts.go b/src/rhosts.go index e8edcda..662d64d 100644 --- a/src/rhosts.go +++ b/src/rhosts.go @@ -69,15 +69,14 @@ func main() { var daemon bool=false var interval int=1440 var versionflag bool=false + var removetimestamp bool=false var siteBuff []siteList - // GPL information - fmt.Println(GPL) - // Parsing Flags flag.BoolVar(&daemon, "d", false, "Should this be run in daemon mode") flag.IntVar(&interval, "t", 1440, "Minutes until next run of daemon") flag.BoolVar(&versionflag, "version", false, "show version information") + flag.BoolVar(&removetimestamp, "removetimestamp", false, "Removes the timestamp, used with logging programs to prevent a double timestamp") flag.Parse() // Display version information @@ -86,6 +85,14 @@ func main() { return } + // Check if timestamp should be removed + if removetimestamp { + log.SetFlags(0) + }else{ + // GPL information + fmt.Println(GPL) + } + if daemon { log.Print("daemon:" , daemon) log.Print("interval:",interval) diff --git a/src/systemd/rhosts.service b/src/systemd/rhosts.service index 50794f8..34a131d 100644 --- a/src/systemd/rhosts.service +++ b/src/systemd/rhosts.service @@ -1,11 +1,11 @@ [Unit] -Description=update the hosts file to remove ads +Description=rhosts updating the hosts file to remove ads Wants=network-online.target After=network.target network-online.target [Service] Type=oneshot -ExecStart=/usr/local/bin/rhosts +ExecStart=/usr/local/bin/rhosts --removetimestamp [Install] WantedBy=multi-user.target