2020-10-12 13:04:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright (c) 2018-2019 Status Research & Development GmbH. Licensed under
|
|
|
|
# either of:
|
|
|
|
# - Apache License, version 2.0
|
|
|
|
# - MIT license
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except
|
|
|
|
# according to those terms.
|
|
|
|
|
|
|
|
if [[ $OS = "Windows_NT" ]]
|
|
|
|
then
|
|
|
|
if [ ! -d "$1" ]; then
|
|
|
|
# Create full path.
|
|
|
|
mkdir -p $1;
|
2020-10-27 11:04:17 +00:00
|
|
|
# Remove all inherited aces from path $1 ACL and grant full access rights
|
|
|
|
# to current user only in $1 ACL.
|
|
|
|
icacls $1 /inheritance:r /grant:r $USERDOMAIN\\$USERNAME:\(OI\)\(CI\)\(F\)&>/dev/null;
|
2020-10-12 13:04:21 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
# Create full path with 0750 permissions.
|
2020-10-12 13:15:15 +00:00
|
|
|
mkdir -m 0750 -p $1
|
2020-10-12 13:04:21 +00:00
|
|
|
fi
|