Skip to content

Commit

Permalink
Update server_info.sh
Browse files Browse the repository at this point in the history
add id in the conf file
  • Loading branch information
czantoine committed Feb 22, 2022
1 parent f717e39 commit 08cbd81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fonction/mysql/server_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ up_time=$(echo $up_time | sed 's/,.*//' | sed 's/ .*//')
day_time=$(uptime | sed 's/.*up//')
day_time=$(echo $day_time | sed 's/,.*//')

mysql -u admin -proot elisa -e "INSERT INTO node_info (host_name, os, ip, date_add, up_time, day_time) VALUES ('Server Wattouat : $host_name', '$os', '$ip_host', NOW(), '$up_time', '$day_time');"
mysql -u admin -proot elisa -e "INSERT INTO node_info (host_name, os, ip, date_add, up_time, day_time) VALUES ('Server Wattouat : $host_name', '$os', '$ip_host', NOW(), '$up_time', '$day_time');"
id_node_info=$(mysql -u admin -proot elisa -h $ip -e "SELECT MAX( id ) FROM node_info;" | sed 's/[^0-9]//g')
id_node_info=$(echo $id_node_info)
echo "# ID of this Server into elisa database" >> /bin/wattouat/wattouat.conf
echo "id_server_info=$id_node_info" >> /bin/wattouat/wattouat.conf

0 comments on commit 08cbd81

Please sign in to comment.