User Tools

Site Tools


pages:scripts:svndeluser

svndeluser

#!/usr/local/bin/bash

if [ "$#" -lt 1 ];
then
        echo "Missing parameter.";
        echo "Usage: svndeluser.sh user1 user2 user3 ...";
        echo "";
        echo "This script creates a backup of passwd.mn and then deletes all users given as arguments from passwd.mn";

        exit;

else
        FORMATTEDDATE=$(date +"%Y-%m-%d-%H-%M-%S");
        cp -a /usr/svn/www/svn/etc/passwd.mn /usr/svn/www/svn/etc/passwd.mn-${FORMATTEDDATE} && echo "Backup of passwd.mn created successfully." || echo "Failed to create backup of passwd.mn.";

        for i in "$@"
        do
                /usr/local/apache2/bin/htpasswd -D /usr/svn/www/svn/etc/passwd.mn $i;
        done

fi

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
pages/scripts/svndeluser.txt · Last modified: 2022/12/31 00:41 by Heiko Mischer