mynode/rootfs/standard/usr/bin/mynode_chpasswd.sh
2019-06-15 18:02:44 -05:00

11 lines
262 B
Bash
Executable File

#!/bin/bash
PASSWORD=$1
HASH=$(echo -n "$PASSWORD" | sha256sum | awk '{print $1}')
# Change Linux Password
echo "admin:$PASSWORD" | chpasswd
# Change RTL password
sed -i "s/rtlPassHashed=.*/rtlPassHashed=$HASH/g" /opt/mynode/RTL/RTL.conf
systemctl restart rtl