mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
configuring zsh
This commit is contained in:
parent
26aed1554a
commit
8fc0cc5876
1 changed files with 26 additions and 0 deletions
26
bin/shell-setup.sh
Executable file
26
bin/shell-setup.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "usage: sudo $0 username"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
user=$1
|
||||
zsh_path='/usr/local/bin/zsh'
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "Editing your shell requires admin rights. Run via 'sudo $0'"
|
||||
exit 1
|
||||
else
|
||||
if [ -f "$zsh_path" ]; then
|
||||
shell_check=$(dscl localhost -read /Local/Default/Users/gene UserShell |grep -c $zsh_path)
|
||||
if [ $shell_check -eq 0 ]; then
|
||||
echo "setting shell via dscl"
|
||||
dscl localhost -change /Local/Default/Users/$user UserShell /bin/bash $zsh_path
|
||||
fi
|
||||
else
|
||||
echo "$zsh_path doesn't exist yet, run Puppet."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue