summaryrefslogtreecommitdiffstats
path: root/remote/tools
diff options
context:
space:
mode:
authorSimon Rettberg2013-02-25 15:56:15 +0100
committerSimon Rettberg2013-02-25 15:56:15 +0100
commitceece6a1b0e309ef32a8b8bcb0ce4a72b2d13e26 (patch)
treedb7da1e6c4664455f7408e9cbae0495a6e8aede1 /remote/tools
parentMerge branch 'master' of ssh://openslx/openslx-ng/tm-scripts (diff)
downloadtm-scripts-ceece6a1b0e309ef32a8b8bcb0ce4a72b2d13e26.tar.gz
tm-scripts-ceece6a1b0e309ef32a8b8bcb0ce4a72b2d13e26.tar.xz
tm-scripts-ceece6a1b0e309ef32a8b8bcb0ce4a72b2d13e26.zip
delete random functions in random files
Diffstat (limited to 'remote/tools')
-rw-r--r--remote/tools/base/base.build26
1 files changed, 0 insertions, 26 deletions
diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build
index 8a327f83..ef2d2d27 100644
--- a/remote/tools/base/base.build
+++ b/remote/tools/base/base.build
@@ -57,32 +57,6 @@ build() {
fi
}
-clean_users_and_groups() {
- # Pass the root directory of the "system" you want to clean, eg '/' for your real machine (probably a bad idea)
- [ $# -ne 1 ] && perror "Missing param to clean_users_and_groups"
- local SYSBASE=$1
- local PASSWD=${SYSBASE}/etc/passwd
- local GROUP=${SYSBASE}/etc/group
- local SHADOW=${SYSBASE}/etc/shadow
- # remove local users from group file (TODO: currently assumes users have ids 1000-1999)
- local LOCALUSERS=$(grep -E '^[^:]+:x?:1[0-9]{3}:' "${PASSWD}" | awk -F ':' '{print $1}')
- for USER in $LOCALUSERS; do
- sed -r -i "s/([:,])${USER}/\1/g" "${GROUP}"
- done
- # fix syntax: remove trailing ',' in group file
- sed -r -i 's/,+$//g' "${GROUP}"
- sed -r -i 's/,+/,/g' "${GROUP}"
- sed -i 's/:,/:/g' "${GROUP}"
- # remove all non-system groups (also assumes users have 1000-1999, so nogroup will be kept)
- grep -v -E '^[^:]+:x?:1[0-9]{3}:' "${GROUP}" > "${GROUP}.tmp"
- mv "${GROUP}.tmp" "${GROUP}"
- # same for users...
- grep -v -E '^[^:]+:x?:1[0-9]{3}:' "${PASSWD}" > "${PASSWD}.tmp"
- mv "${PASSWD}.tmp" "${PASSWD}"
- # generate fresh shadow file
- awk -F ':' '{print $1":*:15555:0:99999:7:::"}' "${PASSWD}" > "${SHADOW}"
-}
-
post_copy() {
# make basic directory structure