All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.bin.chowntree.sh Maven / Gradle / Ivy

Go to download

Runs multiple web applications in multiple tomcats on a single machine. Stool is a command line tool that provides a lifecycle for stages: create, configure, build, run and remove. A stage contains web applications, that may come in different flavors: Maven war projects or artifacts (GAV coordinates).

The newest version!
#! /bin/sh
# usage
#   chowntree newUser dir*

SCRIPT=$(basename $0)
NEWUSER=$1; shift

if [ -z "$NEWUSER" ]; then
    echo "$SCRIPT: missing newUser arguments" 1>&2
    exit 1
fi

if [ "$NEWUSER" = "root" ]
then
  echo "$SCRIPT: chown to root is not allowed" 1>&2
  exit 1
fi

if ! id "$NEWUSER" > /dev/null 2>&1; then
    echo "$SCRIPT: $NEWUSER: no such user" 1>&2
    exit 1
fi

while true ; do
    DIR=$1
    if [ -z $DIR ] ; then
        exit
    fi
    shift
    chown -R "$NEWUSER" "$DIR"
    RET=$?
    if [ ! $RET -eq 0 ]; then
        echo "FAILED: chown -R $NEWUSER $DIR"
        exit $RET
    fi
done




© 2015 - 2024 Weber Informatics LLC | Privacy Policy