# $Id: $
#* $Source: $
#*------------------------------------------------------------------
#*confd_cli - Responsible for Mimicking the confd_cli if the user is root
#*            Error for all other non-root user who is trying to execute confd_cli from XR
#*            All the confd_arguments will be dumped to confd_arg_lxc.txt and later send via CAPI to spawn Confd_cli 
#*            if you need to restrict "-noaaa" option , the you need to restrict it here 
#* june 2019, jobbijos
#*
#* Copyright (c) 2003-2019 by Cisco Systems, Inc.
#* All rights reserved.
#*------------------------------------------------------------------
#* $Log: $
#*------------------------------------------------------------------
#* $Endlog$
#*/
#!/bin/bash                                                                     
#echo $0                                                                        
if [[ $EUID -ne 0 ]]; then                                                      
   echo "Admin access is restricted to 'root' user"                             
   exit 1                                                                       
fi                                                                              
rm -rf /root/confd_arg_lxc.txt                                                            
for i in "$*"                                                                   
do                                                                              
   echo $i >> /root/confd_arg_lxc.txt                                                     
done                                                                            
                                                                                
/pkg/sbin/admin-cli-proxy-xr_static -p XR
