<commit_before>#!/bin/bash
#
# Copyright 2017, 2018 Istio Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
set -e

umask 022

if ! getent passwd istio-proxy >/dev/null; then
    if  find /etc/*release | grep -Eiq 'centos|redhat'; then
        groupadd --system istio-proxy
        useradd --system --gid istio-proxy --home-dir /var/lib/istio istio-proxy
    else
        addgroup --system istio-proxy
        adduser --system --group --home /var/lib/istio istio-proxy
    fi
fi

if [ ! -e /etc/istio ]; then
   # Backward compat.
   ln -s /var/lib/istio /etc/istio
fi

mkdir -p /var/lib/istio/envoy
mkdir -p /var/lib/istio/proxy
mkdir -p /var/lib/istio/config
mkdir -p /var/log/istio

touch /var/lib/istio/config/mesh<commit_msg>Make the adduser evaluation in post-install less OS dependant (#34595)<commit_after>#!/bin/bash
#
# Copyright 2017, 2018 Istio Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
set -e

umask 022

if ! getent passwd istio-proxy >/dev/null; then
    if command -v useradd >/dev/null; then
        groupadd --system istio-proxy
        useradd --system --gid istio-proxy --home-dir /var/lib/istio istio-proxy
    else
        addgroup --system istio-proxy
        adduser --system --group --home /var/lib/istio istio-proxy
    fi
fi

if [ ! -e /etc/istio ]; then
   # Backward compat.
   ln -s /var/lib/istio /etc/istio
fi

mkdir -p /var/lib/istio/envoy
mkdir -p /var/lib/istio/proxy
mkdir -p /var/lib/istio/config
mkdir -p /var/log/istio

touch /var/lib/istio/config/mesh
{'fraction_non_alphanumeric': 0.1561694290976059, 'fraction_numerical': 0.01289134438305709, 'mean_word_length': 3.24375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4597612', 'n_tokens_mistral': 855, 'n_tokens_neox': 808, 'n_words': 309}