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

Commit 730b53b

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 2ed6a97 commit 730b53b

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

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

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

0 commit comments

Comments
 (0)