Skip to content

Commit

Permalink
Fix MAX UID and find command
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammedz93 committed Mar 26, 2023
1 parent dce4f6b commit 71d5ae4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/image_config/reset-factory/reset-factory
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ error_cleanup()
clear_sonic_dir()
{
EXCLUDE_LIST="${CONFIG_DB_JSON}\|/etc/sonic/sonic-environment"
find $SONIC_OVERLAY_UPPERDIR -mindepth 1 | grep -ve ${EXCLUDE_LIST} | xargs rm -rf
find $SONIC_OVERLAY_UPPERDIR -type f | grep -ve ${EXCLUDE_LIST} | xargs rm -rf
# remount root
mount -o remount /
}
Expand All @@ -88,7 +88,7 @@ reset_users()
default_users=$(jq -r '. | keys[]' $DEFAULT_USERS_FILE)
EXCLUDE_LIST=$(echo $default_users | tr ' ' '|')
# Get non-default user accounts
other_users=$(getent passwd | awk -F: '($3>=1000 && $3<=6000) {print $1}' | grep -E -v $EXCLUDE_LIST)
other_users=$(getent passwd | awk -F: '($3>=1000 && $3<=60000) {print $1}' | grep -E -v $EXCLUDE_LIST)
echo "Remove non-default users"
for user in ${other_users[@]}
do
Expand Down

0 comments on commit 71d5ae4

Please sign in to comment.