sync: auto-sync from Mikes-MacBook-Air.local at 2026-07-10 08:30:31
Author: Mike Swanson Machine: Mikes-MacBook-Air.local Timestamp: 2026-07-10 08:30:31
This commit is contained in:
50
.claude/skills/packetdial/scripts/provision-vwp-devices.sh
Normal file
50
.claude/skills/packetdial/scripts/provision-vwp-devices.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# Create SIP devices for VWP extensions 101-118
|
||||
# This auto-generates the device-sip-registration-password for each user
|
||||
|
||||
DOMAIN="vwp.91912.service"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PY_WRAPPER="bash $SCRIPT_DIR/../../../.claude/scripts/py.sh"
|
||||
|
||||
EXTENSIONS=(101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118)
|
||||
|
||||
echo "[INFO] Creating SIP devices for 18 VWP extensions..."
|
||||
echo ""
|
||||
|
||||
SUCCESS=0
|
||||
FAILED=0
|
||||
|
||||
for ext in "${EXTENSIONS[@]}"; do
|
||||
echo "[INFO] Creating device for extension $ext"
|
||||
|
||||
# Create device (device name = user extension)
|
||||
BODY="{\"device\":\"$ext\",\"user\":\"$ext\"}"
|
||||
RESULT=$($PY_WRAPPER "$SCRIPT_DIR/ns.py" create-device "$DOMAIN" "$ext" --body "$BODY" --confirm 2>&1)
|
||||
|
||||
if echo "$RESULT" | grep -q "HTTP 400.*already exists"; then
|
||||
echo " [SKIP] Device $ext already exists"
|
||||
((SUCCESS++))
|
||||
elif echo "$RESULT" | grep -qE "HTTP [45]"; then
|
||||
echo " [ERROR] Failed to create device $ext: $RESULT"
|
||||
((FAILED++))
|
||||
else
|
||||
echo " [OK] Created device $ext"
|
||||
((SUCCESS++))
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "[SUMMARY] Devices: $SUCCESS created/existing, $FAILED failed"
|
||||
echo ""
|
||||
echo "[INFO] Fetching all device passwords..."
|
||||
echo ""
|
||||
|
||||
# Get all passwords
|
||||
for ext in "${EXTENSIONS[@]}"; do
|
||||
PASSWORD=$($PY_WRAPPER "$SCRIPT_DIR/ns.py" devices "$DOMAIN" "$ext" 2>/dev/null | grep -o '"device-sip-registration-password": "[^"]*"' | cut -d'"' -f4)
|
||||
if [ -n "$PASSWORD" ]; then
|
||||
echo "Extension $ext: $PASSWORD"
|
||||
else
|
||||
echo "Extension $ext: [ERROR - Could not retrieve password]"
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
# Provision 11 matched VWP extensions with correct M365 emails
|
||||
# Domain: vwp.91912.service
|
||||
# E911 Address: a-6a395c03d4cfe
|
||||
|
||||
DOMAIN="vwp.91912.service"
|
||||
E911="a-6a395c03d4cfe"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PY_WRAPPER="bash $SCRIPT_DIR/../../../.claude/scripts/py.sh"
|
||||
|
||||
# Matched users: extension|first_name|last_name|email
|
||||
USERS=(
|
||||
"102|Jesse|Guerrero|jesse@valleywideplastering.com"
|
||||
"103|Rose|Guerrero|rose@valleywideplastering.com"
|
||||
"104|Shelly|Dooley|shelly@valleywideplastering.com"
|
||||
"105|JR|Guerrero|j-r@valleywideplastering.com"
|
||||
"107|Payroll|Department|payroll@valleywideplastering.com"
|
||||
"109|Kayla|Guerrero|kayla@valleywideplastering.com"
|
||||
"110|Ron|Winger|ron@valleywideplastering.com"
|
||||
"113|Chris|Guerrero|chris@valleywideplastering.com"
|
||||
"114|Ty|Fetters|Ty@CASARICA.NET"
|
||||
"115|Toni|Billing|billing@valleywideplastering.onmicrosoft.com"
|
||||
"116|Bart|Graffin|estimating@valleywideplastering.com"
|
||||
)
|
||||
|
||||
echo "[INFO] Creating 11 matched VWP users in PacketDial..."
|
||||
echo ""
|
||||
|
||||
SUCCESS=0
|
||||
FAILED=0
|
||||
|
||||
for user_data in "${USERS[@]}"; do
|
||||
IFS='|' read -r ext first last email <<< "$user_data"
|
||||
|
||||
echo "[INFO] Creating extension $ext: $first $last ($email)"
|
||||
|
||||
# Build JSON body (name-last-name is required)
|
||||
BODY="{\"user\":\"$ext\",\"name-first-name\":\"$first\",\"name-last-name\":\"$last\",\"email\":\"$email\",\"emergency-address-id\":\"$E911\"}"
|
||||
|
||||
# Create user
|
||||
RESULT=$($PY_WRAPPER "$SCRIPT_DIR/ns.py" create-user "$DOMAIN" --body "$BODY" --confirm 2>&1)
|
||||
|
||||
if echo "$RESULT" | grep -q "HTTP 400.*already exists"; then
|
||||
echo " [SKIP] Extension $ext already exists"
|
||||
((SUCCESS++))
|
||||
elif echo "$RESULT" | grep -qE "HTTP [45]"; then
|
||||
echo " [ERROR] Failed to create extension $ext: $RESULT"
|
||||
((FAILED++))
|
||||
else
|
||||
echo " [OK] Created extension $ext"
|
||||
((SUCCESS++))
|
||||
fi
|
||||
|
||||
# Small delay to avoid rate limiting
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "[SUMMARY] Users: $SUCCESS created/existing, $FAILED failed"
|
||||
echo "[INFO] Waiting 30 seconds for async processing..."
|
||||
sleep 30
|
||||
|
||||
echo ""
|
||||
echo "[INFO] Verifying user creation..."
|
||||
ACTUAL=$($PY_WRAPPER "$SCRIPT_DIR/ns.py" users "$DOMAIN" 2>/dev/null | grep -c '"user"')
|
||||
echo "[INFO] PacketDial reports $ACTUAL users total"
|
||||
64
.claude/skills/packetdial/scripts/provision-vwp-users.sh
Normal file
64
.claude/skills/packetdial/scripts/provision-vwp-users.sh
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
# Provision VWP extensions 101-118
|
||||
# Domain: vwp.91912.service
|
||||
# E911 Address: a-6a395c03d4cfe
|
||||
|
||||
DOMAIN="vwp.91912.service"
|
||||
E911="a-6a395c03d4cfe"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PY_WRAPPER="bash $SCRIPT_DIR/../../../.claude/scripts/py.sh"
|
||||
|
||||
# User list: extension|first_name|last_name|email
|
||||
USERS=(
|
||||
"101|Natalya||natalya@vwp.com"
|
||||
"102|Jesse||jesse@vwp.com"
|
||||
"103|Rose||rose@vwp.com"
|
||||
"104|Shelly||shelly@vwp.com"
|
||||
"105|J.R.||jr@vwp.com"
|
||||
"106|Tammy||tammy@vwp.com"
|
||||
"107|Payroll|Department|payroll@vwp.com"
|
||||
"108|Shannon||shannon@vwp.com"
|
||||
"109|Kayla||kayla@vwp.com"
|
||||
"110|Ron||ron@vwp.com"
|
||||
"111|Kitchen|Phone|kitchen@vwp.com"
|
||||
"112|Conference|Room|conferenceroom@vwp.com"
|
||||
"113|Chris||chris@vwp.com"
|
||||
"114|TY||ty@vwp.com"
|
||||
"115|Toni||toni@vwp.com"
|
||||
"116|Bart||bart@vwp.com"
|
||||
"117|Jesse|III|jesse3@vwp.com"
|
||||
"118|Warehouse|Phone|warehouse@vwp.com"
|
||||
)
|
||||
|
||||
echo "[INFO] Creating 18 VWP users in PacketDial..."
|
||||
echo ""
|
||||
|
||||
SUCCESS=0
|
||||
FAILED=0
|
||||
|
||||
for user_data in "${USERS[@]}"; do
|
||||
IFS='|' read -r ext first last email <<< "$user_data"
|
||||
|
||||
echo "[INFO] Creating extension $ext: $first $last"
|
||||
|
||||
# Build JSON body (name-last-name is required even if empty)
|
||||
LAST_NAME="${last:-.}"
|
||||
BODY="{\"user\":\"$ext\",\"name-first-name\":\"$first\",\"name-last-name\":\"$LAST_NAME\",\"email\":\"$email\",\"emergency-address-id\":\"$E911\"}"
|
||||
|
||||
# Create user
|
||||
RESULT=$($PY_WRAPPER "$SCRIPT_DIR/ns.py" create-user "$DOMAIN" --body "$BODY" --confirm 2>&1)
|
||||
|
||||
if echo "$RESULT" | grep -q "HTTP 400.*already exists"; then
|
||||
echo " [SKIP] Extension $ext already exists"
|
||||
((SUCCESS++))
|
||||
elif echo "$RESULT" | grep -qE "HTTP [45]"; then
|
||||
echo " [ERROR] Failed to create extension $ext: $RESULT"
|
||||
((FAILED++))
|
||||
else
|
||||
echo " [OK] Created extension $ext"
|
||||
((SUCCESS++))
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "[SUMMARY] Users: $SUCCESS created/existing, $FAILED failed"
|
||||
Reference in New Issue
Block a user