Last active
February 14, 2021 12:30
-
-
Save trebi/e9140a3d038cfd3d8bc0153de44d13a9 to your computer and use it in GitHub Desktop.
"Switch" valet between multiple users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
valet install | |
USER=$(whoami) | |
echo "Updating configuration for user '$USER'" | |
STR='Users\/[a-zA-Z0-9]*\/' | |
REPLACE="Users\/$USER\/" | |
REGEX="s/$STR/$REPLACE/g" | |
sed -i '' -e $REGEX /usr/local/etc/nginx/valet/valet.conf | |
sed -i '' -e $REGEX /usr/local/etc/nginx/nginx.conf | |
find ~/.config/valet/Nginx/*.test -type f -exec sed -i '' -e $REGEX {} \; | |
echo "Configuration for user '$USER' updated" | |
valet restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment