Skip to content

Commit 4da7656

Browse files
authored
Issue 283 (#284)
Improves the setup.sh file and systemd service file by parameterizing the config file path
1 parent 92775dd commit 4da7656

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ if [ "$INSTALL_SERVICE" = "y" ]; then
374374
printf ${PMPT} "Installing AWS IoT Device Client..."
375375
if command -v "systemctl" &>/dev/null; then
376376
systemctl stop aws-iot-device-client.service || true
377+
sed -i "s#/etc/.aws-iot-device-client/aws-iot-device-client.conf#$CONF_OUTPUT_PATH#g" $SERVICE_FILE
377378
cp "$SERVICE_FILE" /etc/systemd/system/aws-iot-device-client.service
378379
if [ "$SERVICE_DEBUG" = "y" ]; then
379380
echo "$DEBUG_SCRIPT" | tee /sbin/aws-iot-device-client >/dev/null

setup/aws-iot-device-client.service

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Wants=network-online.target
44
After=network.target network-online.target
55

66
[Service]
7-
ExecStart=/sbin/aws-iot-device-client --config-file /etc/.aws-iot-device-client/aws-iot-device-client.conf
7+
Environment="CONF_PATH=/etc/.aws-iot-device-client/aws-iot-device-client.conf"
8+
ExecStart=/sbin/aws-iot-device-client --config-file $CONF_PATH
89

910
[Install]
10-
WantedBy=multi-user.target
11+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)