diff --git a/ce/03_files_availability.sh b/ce/03_files_availability.sh new file mode 100755 index 0000000..506e34f --- /dev/null +++ b/ce/03_files_availability.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +i=1 +declare -a FILES=( "/etc/ngcp_version" \ + "/etc/sipwise_ngcp_version" \ + "/etc/apt/sources.list.d/sipwise.list" \ + "/etc/ngcp-config/config.yml" \ + "/etc/ngcp-config/constants.yml" \ + "/etc/ngcp-config/network.yml" \ + ) + +echo "1..$(( 2 *${#FILES[@]} ))" + +for FILE in "${FILES[@]}" ; do + + if [ -f ${FILE} ]; then + echo "ok $i - Found file: ${FILE}" + else + echo "not ok $i - File not found: ${FILE}" + fi + i=$(($i+1)) + + COUNT=$(stat -c%s ${FILE} 2>/dev/null || echo 0) + if [ "$COUNT" != "0" ]; then + echo "ok $i - File is not empty: ${FILE}" + else + echo "not ok $i - File is empty: ${FILE}" + fi + i=$(($i+1)) + +done diff --git a/pro/03_files_availability.sh b/pro/03_files_availability.sh new file mode 120000 index 0000000..68828e2 --- /dev/null +++ b/pro/03_files_availability.sh @@ -0,0 +1 @@ +../ce/03_files_availability.sh \ No newline at end of file