The IP lookup seems to have a space in it

This commit is contained in:
Bradley Bickford 2023-12-11 20:12:23 -05:00
parent 40ae4f1ec8
commit 7032b4974c

View File

@ -108,7 +108,7 @@ su -c "cp -f $SCRIPTDIR/config.yaml ~/.config/code-server" "$USERNAME"
echo "Setting specific user configs" echo "Setting specific user configs"
IP="$(hostname -I | head -n 1)" IP="$(hostname -I | head -n 1 | tr -d ' ')"
NEW_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 20; echo)" NEW_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 20; echo)"
su -c "sed -i 's/IPADDRESS:PORT/$IP:$PORT/g;s/PASSWORD/$NEW_PASS/g;' ~/.config/code-server/config.yaml" "$USERNAME" su -c "sed -i 's/IPADDRESS:PORT/$IP:$PORT/g;s/PASSWORD/$NEW_PASS/g;' ~/.config/code-server/config.yaml" "$USERNAME"