minor fix on user install script
parent
1bce77c432
commit
a343849055
|
@ -10,7 +10,7 @@ uci_bash_shell_install () {
|
|||
[[ $EUID -ne 0 ]] && usesudo=sudo
|
||||
$usersudo $SHELL $install_dir/scripts/copy-etc.sh
|
||||
$usersudo $SHELL $install_dir/scripts/copy-root.sh
|
||||
[[ $(id -u $1 2> /dev/null) ]] && $usersudo $SHELL $install_dir/scripts/copy-user.sh "$@"
|
||||
[[ $1 ]] && [[ $(id -u $1 2> /dev/null) ]] && $usersudo $SHELL $install_dir/scripts/copy-user.sh "$@"
|
||||
}
|
||||
|
||||
# # if script was executed then call the function
|
||||
|
|
|
@ -4,6 +4,7 @@ local user; local user_home; local subdir; local dir
|
|||
install_dir=${install_dir:-"$(dirname $(dirname $(realpath "${BASH_SOURCE:-$0}")))"}
|
||||
[[ $1 == "-d" ]] && { shift; subdir=test; shift; } || subdir=shell
|
||||
user=${1:-$USER}
|
||||
|
||||
echo $subdir $user $USER
|
||||
|
||||
[[ $(id -u $user 2> /dev/null) -eq 0 ]]
|
||||
|
@ -36,11 +37,11 @@ fi
|
|||
echo -e "*********** create UCI BASH Shell directories for user in $dir *******"
|
||||
sdir=$user_home/$subdir
|
||||
subdirs="alias env ssh/config ssh/mounts /startup"
|
||||
for dir in $BASH_SHELL_BASE/.bash-shell-include; do
|
||||
echo mkdir -p $sdir/$dir
|
||||
for dir in $(cat $BASH_SHELL_BASE/.bash-shell-include); do
|
||||
mkdir -p $sdir/$dir
|
||||
done
|
||||
chown -R $user:$user $sdir
|
||||
}
|
||||
echo chown -R $user:$user $sdir
|
||||
|
||||
# # if script was executed then call the function
|
||||
(return 0 2>/dev/null) || uci_bash_shell_user_create "$@"
|
Loading…
Reference in New Issue