File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Step 1: Login to get the token
4+ login_response=$( curl -s -X POST http://localhost:8080/login \
5+ -H " Content-Type: application/json" \
6+ -d ' {"username": "ghouse", "password": "idontlikepeople"}' )
7+
8+ echo " $login_response "
9+
10+ sleep 1
11+
12+ # Step 2: Extract token using jq (requires jq to be installed)
13+ token=$( echo " $login_response " | jq -r ' .token' )
14+
15+ # Optional: check if token is empty
16+ if [ -z " $token " ] || [ " $token " == " null" ]; then
17+ echo " Failed to get JWT token"
18+ echo " Response: $login_response "
19+ exit 1
20+ fi
21+
22+ echo $token
23+
24+ while true ; do
25+ curl -X POST http://localhost:8080/transactions/schedule \
26+ -H " Authorization: Bearer $token " \
27+ -H " Content-Type: application/json" \
28+ -d ' {
29+ "operation": "setfacl",
30+ "targetPath": "/mnt/nfs-system/home/maverick/linux-acl-management-aclapi/README.md",
31+ "entries": {
32+ "entityType": "user",
33+ "entity": "tommy",
34+ "permissions": "rw-",
35+ "action": "modify"
36+ }
37+ }'
38+ done
You can’t perform that action at this time.
0 commit comments