Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #216, Update the way hostname is set. #256

Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -1,11 +1,16 @@
#!/bin/bash

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
@@ -19,12 +19,17 @@ function signal_handler()
kill $pid
}

# On ResinOS 2.x devices, the hostname is set by the hostOS.
# For backward compatibility, we only update the hostname for ResinOS 1.x devices.
function update_hostname()
{
HOSTNAME="$HOSTNAME-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
if [ ${RESIN_DEVICE_UUID:0:7} != ${HOSTNAME:0:7} ]; then
# For 1.x Devices only.
HOSTNAME="$RESIN_DEVICE_TYPE-${RESIN_DEVICE_UUID:0:7}"
echo $HOSTNAME > /etc/hostname
echo "127.0.1.1 $HOSTNAME" >> /etc/hosts
hostname "$HOSTNAME"
fi
}

function mount_dev()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.