diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-03 21:03:35 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-03 21:03:35 -0500 |
| commit | cd0f9163da3b647bdc7d7f716750fd4f56fdd8eb (patch) | |
| tree | ae2869e5ce375a929db0c1bf4689d9e03dcd40ac /kshrc | |
| parent | 3650ff34c6b50966898cc33cb15337c784510a84 (diff) | |
| download | dotfiles-cd0f9163da3b647bdc7d7f716750fd4f56fdd8eb.tar.gz dotfiles-cd0f9163da3b647bdc7d7f716750fd4f56fdd8eb.tar.xz | |
Add subid shell func
Diffstat (limited to 'kshrc')
| -rw-r--r-- | kshrc | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -373,6 +373,35 @@ passenv() { rm -f "$_f" } +# gensubids is useful for generating /etc/subuid and /etc/subgid +# if you have say a 3rd user you want to add +gensubids() { + _step=65536 + _err=0 + _un= + _n= + while [ $# -gt 0 ] ; do case $1 in + -u) _un="$2"; shift ; shift ;; + -n) _n="$2"; shift ; shift ;; + *) + echo "unknown option: $1"; + echo "gensubids -u <username> -n <entry_number>"; + return 1 ;; + esac ; done + if [ -z "$_n" ] ; then + echo "need a number" + _err=1 + fi + if [ -z "$_un" ] ; then + echo "need a username" + _err=1 + fi + if [ "$_err" -eq 1 ] ; then + return 1; + fi + echo "$_un:$(( (_n*_step) + 1 )):$(( (_n*_step) + _step ))" +} + scangit() { ref="origin/master" while [ $# -gt 0 ] ; do case $1 in |
