How to add a hotplug to make symlink?

To make a symlink between /proc/device-tree/aliases/serial1 ->/dev/ttyAMA0.For that i have tried one script in /etc/hotplug.d/uart/99-com,which is as follows.

#! /bin/sh

SYMLINK="ttyAMA0"
if[ "${ACTION}" = "add" ]; then
                logger -t To create Hotplug Symlink
                DEVICE_NAME=$(cat /proc/device-tree/aliases/serial1)
                ln -s /dev/$DEVICE_NAME /dev/${SYMLINK}
                logger -t Symlink from /dev/$DEVICE_NAME to /dev/${SYMLINK} created.
fi

Can anyone please tell me what is the mistake I am doing here because of that symlink is not happening.

Hello @smdharris!
Please give us more details like debug and env vars during the execution of your hotplug event.
There are more details how to create debug information on https://wiki.openwrt.org/doc/techref/hotplug#troubleshoot.
I sure you are going to do this staps easily.

Missing whitespace after if.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.