Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit baac4d0

Browse files
author
Federico Guerinoni
committed
Move binary in /usr/bin
This fix #234, in this way the path for service is /usr/bin and during script of installation will be moved in that path. Signed-off-by: Federico Guerinoni <guerra@develer.com>
1 parent e37eff2 commit baac4d0

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

arduino-connector.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# This file is part of arduino-connector
55
#
6-
# Copyright (C) 2017-2018 Arduino AG (http://www.arduino.cc/)
6+
# Copyright (C) 2017-2020 Arduino AG (http://www.arduino.cc/)
77
#
88
# Licensed under the Apache License, Version 2.0 (the "License");
99
# you may not use this file except in compliance with the License.
@@ -71,18 +71,18 @@ fi
7171
echo download connector
7272
echo ---------
7373
download https://downloads.arduino.cc/tools/feed/arduino-connector/arduino-connector
74-
chmod +x arduino-connector
74+
sudo mv arduino-connector /usr/bin/arduino-connector
75+
sudo chmod +x /usr/bin/arduino-connector
7576

7677
echo install connector
7778
echo ---------
7879
if [ "$password" == "" ]
7980
then
80-
sudo -E ./arduino-connector -register -install
81+
sudo -E arduino-connector -register -install
8182
else
82-
echo $password | sudo -kS -E ./arduino-connector -register -install > arduino-connector.log 2>&1
83+
echo $password | sudo -kS -E arduino-connector -register -install > arduino-connector.log 2>&1
8384
fi
8485

85-
8686
echo start connector service
8787
echo ---------
8888
if [ "$password" == "" ]

install.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
"github.com/arduino/arduino-connector/auth"
4343
mqtt "github.com/eclipse/paho.mqtt.golang"
4444
"github.com/facchinm/service"
45-
"github.com/kardianos/osext"
4645
"github.com/pkg/errors"
4746
)
4847

@@ -350,14 +349,12 @@ func (p *program) Stop(s service.Service) error {
350349

351350
// createService returns the servcie to be installed
352351
func createService(config Config, configFile, listenFile string) (service.Service, error) {
353-
workingDirectory, _ := osext.ExecutableFolder()
354-
355352
svcConfig := &service.Config{
356353
Name: "ArduinoConnector",
357354
DisplayName: "Arduino Connector Service",
358355
Description: "Cloud connector and launcher for IoT devices.",
359356
Arguments: []string{"-config", configFile},
360-
WorkingDirectory: workingDirectory,
357+
WorkingDirectory: "/usr/bin",
361358
Dependencies: []string{"network-online.target"},
362359
}
363360

0 commit comments

Comments
 (0)