Hi astrogeek,
Thanks for the information. Well to share further about my initial post.
I have info.conf file which is hidden and the info.conf contains following information:
Code:
"device.node_id": "server01",
"ftp.banner": "FTP server ready",
"ftp.enabled": false,
"ftp.port": 21
Now I want to have a shell script which will update the value of "device.node_id": to specified value. So to achieve that i have done the following script which works fine with only config file which is marked as executable.
Code:
#!/bin/bash
#Edit note name with double quotation e.g. "webserver01".
newNode="server211"
#Set OpenCanary Configuration File Path
openCanaryConfig="info.conf"
sed -i 's/\(^"device.node_id":\).*/\1 "'$newNode'",/' $openCanaryConfig
After running the above script my info.conf file changes to:
Code:
"device.node_id": "server211",
"ftp.banner": "FTP server ready",
"ftp.enabled": false,
"ftp.port": 21
But how to do with configuration file which is marked as executable (like info.conf*)
Info: when i run ll in terminal, i see * being marked at the end of info.conf file.
Can you please suggest, hope i have missed a option.
Thanks