This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kas-docker build kas/poky.yml:kas/tftp.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# In case of issue running Docker, please add your user to the docker's group | |
# | |
# sudo usermod -aG docker ${USER} | |
# | |
# then, logout and log in | |
git clone https://github.com/siemens/kas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# check_if_file_contains_string | |
# - param1: file containing the text | |
# - param2: string to find | |
# - param3: message for success | |
# - param4: message for failure | |
# | |
check_if_file_contains_string() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# INSERT COLOR SECTION HERE | |
# INSERT "RUN AS ROOT" SECTION HERE | |
# INSERT DISPLAY HELP FUNCTION HERE | |
# INSERT BANNER HERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Patch the script 20-networking.sh as there is an issue due to the use of /etc | |
sudo sed -i 's#\" \> /etc/wpa_supplicant#\" \> \$\{ETC_DIR\}/wpa_supplicant#g' ./bootstrap.d/20-networking.sh | |
# The condition is wrong | |
sudo sed -i 's/if \[ -z \"\$NET_WIFI_SSID\" \] \&\& \[ -z \"\$NET_WIFI_PSK\" \] \; then/if \[ \! -z \"\$NET_WIFI_SSID\" \] \&\& \[ \! -z \"\$NET_WIFI_PSK\" \] \; then/g' ./bootstrap.d/20-networking.sh | |
# The variables are not the right ones | |
sudo sed -i "s#NET_SSID#NET_WIFI_SSID#g" ./bootstrap.d/20-networking.sh | |
sudo sed -i "s#NET_WPAPSK#NET_WIFI_PSK#g" ./bootstrap.d/20-networking.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# analyze_test_result | |
# | |
analyze_test_result() { | |
if [ ${TEST_COUNT} -eq ${PASSED_TEST_COUNT} ]; then | |
banner "SUCCESS" | |
echo -e "${GREEN}${TEST_COUNT} tests passed${RESET_COLOR}" | |
exit 0 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# is_file_included | |
# - param1: original file | |
# - param2: contained file | |
# | |
is_file_included() { | |
local ORIGINAL_FILE=${WORKDIR}/file1 | |
local CONTAINED_FILE=${WORKDIR}/file2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# check_installed_packages | |
# | |
check_installed_packages(){ | |
local PACKAGE_LIST=("$@") # Rebuild the array with rest of arguments | |
for index in "${PACKAGE_LIST[@]}"; | |
do | |
TEST_COUNT=$((TEST_COUNT + 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# check_if_file_exists: test if the file exist and is not empty | |
# - param1: full qualified filename | |
# - param2: file type (script, configuration file, ...) | |
# | |
check_if_file_exists() { | |
local FILENAME=${1} | |
local FILE_TYPE=${2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# test_failed | |
# - param1: the message to display | |
# | |
test_failed() { | |
local MESSAGE=${1} | |
echo -e "${TEST_RESULT_KO} ${MESSAGE}" | |
} |
NewerOlder