install2
This commit is contained in:
+4
-4
@@ -27,8 +27,8 @@ function install_required_packages {
|
||||
|
||||
function fix_users_bashrc {
|
||||
# for new users
|
||||
if ! cmp -s /etc/skill/.bashrc "$MIAOU_BASH_DIR"/etc/skel/.bashrc; then
|
||||
sudo mv /etc/skill/.bashrc /etc/skill/.bashrc.ORIGINAL
|
||||
if ! cmp -s /etc/skel/.bashrc "$MIAOU_BASH_DIR"/etc/skel/.bashrc; then
|
||||
sudo mv /etc/skel/.bashrc /etc/skel/.bashrc.ORIGINAL
|
||||
sudo ln -sf "$MIAOU_BASH_DIR"/etc/skel/.bashrc /etc/skel/.bashrc
|
||||
|
||||
# for pre-existant users
|
||||
@@ -36,11 +36,11 @@ function fix_users_bashrc {
|
||||
for user in "${!USER_HOMES[@]}"; do
|
||||
local user_bashrc="${USER_HOMES[$user]}/.bashrc"
|
||||
[[ ! -f "$user_bashrc" ]] && next
|
||||
cmp -s "$user_bashrc" "$MIAOU_BASH_DIR"/etc/skell/.bashrc && next
|
||||
cmp -s "$user_bashrc" "$MIAOU_BASH_DIR"/etc/skel/.bashrc && next
|
||||
|
||||
local backup="$user_bashrc".ORIGINAL
|
||||
sudo -u "$user" -- mv "$user_bashrc" "$backup"
|
||||
sudo -u "$user" -- cp "$MIAOU_BASH_DIR"/etc/skell/.bashrc "$user_bashrc"
|
||||
sudo -u "$user" -- cp "$MIAOU_BASH_DIR"/etc/skel/.bashrc "$user_bashrc"
|
||||
>&2 echo "WARN: .bashrc for user <$user> has already been diverged, please resolve conflict manually from backup: $backup"
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user