Browse Source

added scripts

master
Mario Alegre 5 years ago
parent
commit
6a017d8322
  1. 11
      linux/bash/adduser-sys.sh
  2. 2
      linux/bash/chmod-dirs.sh

11
linux/bash/adduser-sys.sh

@ -0,0 +1,11 @@
#!/bin/bash
if [[ -z $1 || -z $2 ]]; then
echo "Usage: $0 USER UID"
exit 1
fi
usr=$1
uid=$2
addgroup --gid ${uid:?} ${usr:?} --system
adduser --uid ${uid:?} --ingroup ${usr:?} ${usr:?} --disabled-password --gecos "" --system --no-create-home --shell /usr/sbin/nologin --home /nonexistent
printf "[User]\nSystemAccount=true\n" > /var/lib/AccountsService/users/${usr:?}

2
linux/bash/chmod-dirs.sh

@ -0,0 +1,2 @@
#!/bin/sh
find $2 -type d -exec chmod $1 {} \;
Loading…
Cancel
Save