When running a script in **/config/scripts/** directory getting an error:
admin_mce_david@osr-01# sudo /config/scripts/getVpnUsers.sh
**/opt/vyatta/share/vyatta-cfg/functions/interpreter/vyatta-cfg-run: line 161: `vyatta_config_commit-confirm': not a valid identifier**
We tried to fix this line. Then we saw error in a different place:
**/etc/bash_completion.d/vyatta-cfg: line 673: syntax error near unexpected token `<'**
I think this kind of problem can be in different places.
I am sharing one of the scrips which may be helpful:
```
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
if [ "$(id -g -n)" != 'vyattacfg' ] ; then
exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
fi
#####################################
# Author: David H Smith
# Org: Kiapo Private Clouds
# Version: v1.1.0
# Date: 2021-07-15
# Description: VPN Usage Collector
# Usage: ./getVpnUsers.sh
################6####################
# Initialize Globals
HOME_DIR=~
VERSION_SYSTEM="Kiapo VPN Usage Collector v1.0.0 :"
date=$(date +"%Y-%m-%d %H:%M")
date_short=$(date +"%Y-%m-%d")
log_path="/config/logs"
logfile="${log_path}/remote_user_access_${date_short}.log"
# Set up Log file
if [[ ! -f ${logfile} ]]; then
touch ${logfile}
echo ${VERSION_SYSTEM} >> ${logfile}
fi
# Get current users and append to log file
echo "BEGIN: Measurement taken at: ${date}" >> ${logfile}
run show vpn remote-access >> ${logfile}
echo "END: " >> ${logfile}
exit
scp ${logfile} paul@192.168.10.149:~/Log
```