add support for mkdir when parent folders arent created
This commit is contained in:
parent
2fef0f1c9f
commit
080a546bfb
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## Add accounts and shared folder for two users given as two arguments $1 and $2
|
## Add accounts and shared folder for two users given as two arguments $1 and $2
|
||||||
|
|
||||||
|
DMZKEYFILE=$(echo -n ~)"/.ssh/dmz"
|
||||||
|
|
||||||
USER1=$1
|
USER1=$1
|
||||||
USER2=$2
|
USER2=$2
|
||||||
HOST="$3"
|
HOST="$3"
|
||||||
@ -19,4 +21,5 @@ if [[ -z "$HOST" ]]; then
|
|||||||
HOST="dmzkrovsshfs12"
|
HOST="dmzkrovsshfs12"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
torsocks ssh $HOST "adduser $USER1 ; adduser $USER2 ; groupadd $USER1$USER2 ; adduser $USER2 $USER1$USER2 ; adduser $USER1 $USER1$USER2 ; mkdir /var/shareddirs/$USER1$USER2 ; chown $USER1:$USER1$USER2 /var/shareddirs/$USER1$USER2 ; chmod 2770 /var/shareddirs/$USER1$USER2 "
|
ssh-add -t 100 $DMZKEYFILE
|
||||||
|
torsocks ssh $HOST "adduser $USER1 ; adduser $USER2 ; groupadd $USER1$USER2 ; adduser $USER2 $USER1$USER2 ; adduser $USER1 $USER1$USER2 ; mkdir -p /var/shareddirs/$USER1$USER2 ; chown $USER1:$USER1$USER2 /var/shareddirs/$USER1$USER2 ; chmod 2770 /var/shareddirs/$USER1$USER2 "
|
||||||
|
Loading…
Reference in New Issue
Block a user