commit 3dc375eafae7e72953d57e29c75a9948e40eb95a parent 1d3af82c873d57cf5e06319537281bef28ba1522 Author: Miniontoby <tobias.gaarenstroom@gmail.com> Date: Wed, 12 Jan 2022 14:29:06 +0000 FIxed installed thing Diffstat:
M | install.sh | | | 40 | +++++++++++++++++++++++----------------- |
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/install.sh b/install.sh @@ -19,22 +19,28 @@ fi wget -O /tmp/ksh_completion "https://ircforever.org/ksh_completion" -USERS=$(ls /home) - -for USER in $USERS; do - cp /tmp/ksh_completion /home/$USER/.ksh_completions - if [ \! -f /home/$USER/.kshrc ]; then - if grep -q "if \[ -e ~/.ksh_completions ]; then . ~/.ksh_completions fi" /home/$USER/.profile; then - continue - else - echo "if [ -e ~/.ksh_completions ]; then . ~/.ksh_completions fi" >> /home/$USER/.profile - fi - else - if grep -q "if \[ -e ~/.ksh_completions ]; then . ~/.ksh_completions fi" /home/$USER/.kshrc; then - continue +function Install { + USERS=$1 + LOCATION=$2 + for USER in $USERS; do + cp /tmp/ksh_completion $LOCATION$USER/.ksh_completions + if [ \! -f $LOCATION$USER/.kshrc ]; then + if grep -q "if \[ -e ~/.ksh_completions ]; then . ~/.ksh_completions; fi" $LOCATION$USER/.profile; then + continue + else + echo "if [ -e ~/.ksh_completions ]; then . ~/.ksh_completions; fi" >> $LOCATION$USER/.profile + fi else - echo "if [ -e ~/.ksh_completions ]; then . ~/.ksh_completions fi" >> /home/$USER/.kshrc - fi - fi -done + if grep -q "if \[ -e ~/.ksh_completions ]; then . ~/.ksh_completions; fi" $LOCATION$USER/.kshrc; then + continue + else + echo "if [ -e ~/.ksh_completions ]; then . ~/.ksh_completions; fi" >> $LOCATION$USER/.kshrc + fi + fi + done +} + +USERS=$(ls /home) +Install "$USERS" /home/ +Install "skel" /etc/