privateone commited on
Commit
6c3fcb8
Β·
verified Β·
1 Parent(s): aa5bf7c

Update init.sh

Browse files
Files changed (1) hide show
  1. init.sh +17 -3
init.sh CHANGED
@@ -21,7 +21,7 @@ if [ -n "$GITHUB_PAT" ]; then
21
  echo "πŸ“ Latest Git Commit:"
22
 
23
  git log -1 --pretty=format:"πŸ”Ή %h πŸ”Ή %s πŸ”Ή by %an πŸ”Ή on %ad" --date=short πŸ”Ή
24
- echo -e "\n"
25
 
26
  echo "πŸ“‚ Moving contents from $TARGET_DIR to $APP_DIR..."
27
  shopt -s dotglob # include hidden files like .env, .gitignore
@@ -35,8 +35,22 @@ if [ -n "$GITHUB_PAT" ]; then
35
  # chmod -R 777 "$APP_DIR/*"
36
  ls -la "$APP_DIR"
37
  echo "πŸ”§ Setting up sessions & permissions..."
38
- mkdir "$APP_DIR/clients_sessions"
39
- chmod -R 777 "$APP_DIR/clients_sessions"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  else
41
  echo "βœ… Repository already cloned at $TARGET_DIR"
42
  fi
 
21
  echo "πŸ“ Latest Git Commit:"
22
 
23
  git log -1 --pretty=format:"πŸ”Ή %h πŸ”Ή %s πŸ”Ή by %an πŸ”Ή on %ad" --date=short πŸ”Ή
24
+ echo
25
 
26
  echo "πŸ“‚ Moving contents from $TARGET_DIR to $APP_DIR..."
27
  shopt -s dotglob # include hidden files like .env, .gitignore
 
35
  # chmod -R 777 "$APP_DIR/*"
36
  ls -la "$APP_DIR"
37
  echo "πŸ”§ Setting up sessions & permissions..."
38
+ SESSION_DIR="$APP_DIR/sessions"
39
+ chmod -R 777 "$APP_DIR/sessions"
40
+
41
+ echo "πŸ” Scanning files in: $SESSION_DIR"
42
+ echo
43
+
44
+ find "$SESSION_DIR" -type f | while read -r file; do
45
+ perms=$(stat -c "%A" "$file") # Get permission string
46
+ if [ -w "$file" ]; then
47
+ writable="βœ… Writable"
48
+ else
49
+ writable="❌ Not Writable"
50
+ fi
51
+ echo "$perms $writable β†’ $file"
52
+ done
53
+
54
  else
55
  echo "βœ… Repository already cloned at $TARGET_DIR"
56
  fi