This script will find a cluster ID and terminate all user`s sessions.
#!/bin/bash
# Run the Remote Administration Server (RAS) in daemon mode to manage the 1C cluster.
/opt/1C/v8.3/x86_64/ras --daemon cluster
# Get the cluster`s ID
_cluster=$(/opt/1C/v8.3/x86_64/rac cluster list | grep 'cluster '| awk -F' ' '{print $3}')
# Get active sessions
_session=$(/opt/1C/v8.3/x86_64/rac session --cluster=$_cluster list | grep 'session '| awk '{print$3}')
# List the cluster ID and all sessions ID
echo 'Cluster: ' $_cluster
echo 'Sessions: ' $_session
# Close all found sessions
for session in $_session
do
/opt/1C/v8.3/x86_64/rac session --cluster=$_cluster terminate --session=$session
done
# Check, list sessions on the cluster (if ok = no sessions)
/opt/1C/v8.3/x86_64/rac session --cluster=$_cluster list