Skip to content

Instantly share code, notes, and snippets.

@erikerlandson
Created July 20, 2017 22:25
Show Gist options
  • Save erikerlandson/ffdfbe14c41a28b39962b2b67ce27155 to your computer and use it in GitHub Desktop.
Save erikerlandson/ffdfbe14c41a28b39962b2b67ce27155 to your computer and use it in GitHub Desktop.
updating a passwd file for randomized openshift uid to make apache spark happy
if [ `id -u` -ge 10000 ]; then
cat /etc/passwd | sed -e "s/^$NB_USER:/builder:/" > /tmp/passwd
echo "$NB_USER:x:`id -u`:`id -g`:,,,:/home/$NB_USER:/bin/bash" >> /tmp/passwd
cat /tmp/passwd > /etc/passwd
rm /tmp/passwd
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment