set default uid and gid to 2000
This commit is contained in:
parent
389194367f
commit
15290cd0ec
5 changed files with 19 additions and 15 deletions
|
@ -34,9 +34,11 @@ do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
if cat /etc/passwd | grep "x:1000" > /dev/null; then
|
if cat /etc/passwd | grep "x:2000" > /dev/null; then
|
||||||
tempuser=$(cat /etc/passwd | grep "x:1000" | awk '{print $1}')
|
tempuser=$(cat /etc/passwd | grep "x:2000" | awk '{print $1}')
|
||||||
user=${tempuser%%:*}
|
user=${tempuser%%:*}
|
||||||
|
#else
|
||||||
|
# user=$(whoami)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function pacmanconf() {
|
function pacmanconf() {
|
||||||
|
@ -104,8 +106,8 @@ function standartinstallation() {
|
||||||
|
|
||||||
function addusers() {
|
function addusers() {
|
||||||
# Erstelle Gruppen
|
# Erstelle Gruppen
|
||||||
groupid=1000
|
groupid=2000
|
||||||
for wort in users wheel audio input power storage video sys optical adm lp scanner sddm kvm fuse autologin network wireshark docker libvirt libvirtdbus; do
|
for wort in master users wheel audio input power storage video sys optical adm lp scanner sddm kvm fuse autologin network wireshark docker libvirt libvirtdbus; do
|
||||||
if ! cat /etc/group | grep ${wort}; then
|
if ! cat /etc/group | grep ${wort}; then
|
||||||
while cat /etc/group | grep ${groupid}; do
|
while cat /etc/group | grep ${groupid}; do
|
||||||
groupid=$((${groupid} + 1))
|
groupid=$((${groupid} + 1))
|
||||||
|
@ -114,12 +116,12 @@ function addusers() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
useruid=1000
|
useruid=2000
|
||||||
while cat /etc/passwd | grep ${useruid}; do
|
while cat /etc/passwd | grep ${useruid}; do
|
||||||
useruid=$((${useruid} + 1))
|
useruid=$((${useruid} + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
useradd -m -g users -G wheel,audio,input,power,storage,video,sys,optical,adm,lp,scanner,sddm,kvm,fuse,autologin,network,wireshark,docker,libvirt,libvirtdbus -s /usr/bin/zsh --uid ${useruid} ${user}
|
useradd -m -g master -G users,wheel,audio,input,power,storage,video,sys,optical,adm,lp,scanner,sddm,kvm,fuse,autologin,network,wireshark,docker,libvirt,libvirtdbus -s /usr/bin/zsh --uid ${useruid} ${user}
|
||||||
echo "${user}:${userpass}" | chpasswd
|
echo "${user}:${userpass}" | chpasswd
|
||||||
mkdir -p /home/${user}/
|
mkdir -p /home/${user}/
|
||||||
userrechte
|
userrechte
|
||||||
|
@ -255,7 +257,7 @@ pacmanconf
|
||||||
if [ "$1" == "adduser" ]; then
|
if [ "$1" == "adduser" ]; then
|
||||||
user="$2"
|
user="$2"
|
||||||
userpass="$3"
|
userpass="$3"
|
||||||
if cat /etc/passwd | grep "x:1000" > /dev/null; then
|
if cat /etc/passwd | grep "x:2000" > /dev/null; then
|
||||||
echo "${user} existiert bereits!!!"
|
echo "${user} existiert bereits!!!"
|
||||||
else
|
else
|
||||||
addusers
|
addusers
|
||||||
|
|
|
@ -11,8 +11,8 @@ repo1=shell-scripte-code
|
||||||
cache=/var/cache/pacman/pkg/
|
cache=/var/cache/pacman/pkg/
|
||||||
repo_url="https://git.spectreos.de/simono41/SpectreOS/raw/master/repo.sh"
|
repo_url="https://git.spectreos.de/simono41/SpectreOS/raw/master/repo.sh"
|
||||||
|
|
||||||
if cat /etc/passwd | grep "x:1000" > /dev/null; then
|
if cat /etc/passwd | grep "x:2000" > /dev/null; then
|
||||||
tempuser=$(cat /etc/passwd | grep "x:1000" | awk '{print $1}')
|
tempuser=$(cat /etc/passwd | grep "x:2000" | awk '{print $1}')
|
||||||
user=${tempuser%%:*}
|
user=${tempuser%%:*}
|
||||||
else
|
else
|
||||||
user=$(whoami)
|
user=$(whoami)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
if cat /etc/passwd | grep "x:1000" > /dev/null; then
|
if cat /etc/passwd | grep "x:2000" > /dev/null; then
|
||||||
tempuser=$(cat /etc/passwd | grep "x:1000" | awk '{print $1}')
|
tempuser=$(cat /etc/passwd | grep "x:2000" | awk '{print $1}')
|
||||||
user=${tempuser%%:*}
|
user=${tempuser%%:*}
|
||||||
else
|
else
|
||||||
user=$(whoami)
|
user=$(whoami)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
if cat /etc/passwd | grep "x:1000" > /dev/null; then
|
if cat /etc/passwd | grep "x:2000" > /dev/null; then
|
||||||
tempuser=$(cat /etc/passwd | grep "x:1000" | awk '{print $1}')
|
tempuser=$(cat /etc/passwd | grep "x:2000" | awk '{print $1}')
|
||||||
user=${tempuser%%:*}
|
user=${tempuser%%:*}
|
||||||
else
|
else
|
||||||
user=$(whoami)
|
user=$(whoami)
|
||||||
|
|
|
@ -6,9 +6,11 @@ cmdlineparameter=$(cat /proc/cmdline)
|
||||||
repo=SpectreOS
|
repo=SpectreOS
|
||||||
user=user1
|
user=user1
|
||||||
|
|
||||||
if cat /etc/passwd | grep "x:1000" > /dev/null; then
|
if cat /etc/passwd | grep "x:2000" > /dev/null; then
|
||||||
tempuser=$(cat /etc/passwd | grep "x:1000" | awk '{print $1}')
|
tempuser=$(cat /etc/passwd | grep "x:2000" | awk '{print $1}')
|
||||||
user=${tempuser%%:*}
|
user=${tempuser%%:*}
|
||||||
|
#else
|
||||||
|
# user=$(whoami)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for wort in $(cat /proc/cmdline)
|
for wort in $(cat /proc/cmdline)
|
||||||
|
|
Loading…
Reference in a new issue