diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2211df6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/bluetooth/classic_discoverable/make_conference.sh b/bluetooth/classic_discoverable/make_conference similarity index 100% rename from bluetooth/classic_discoverable/make_conference.sh rename to bluetooth/classic_discoverable/make_conference diff --git a/bluetooth/iBeacon/make_conference.sh b/bluetooth/iBeacon/make_conference similarity index 100% rename from bluetooth/iBeacon/make_conference.sh rename to bluetooth/iBeacon/make_conference diff --git a/make_conference_full.sh b/make_conference_full similarity index 96% rename from make_conference_full.sh rename to make_conference_full index 8969422..4eae2ec 100755 --- a/make_conference_full.sh +++ b/make_conference_full @@ -38,8 +38,8 @@ fi for challenge in bluetooth/iBeacon bluetooth/classic_discoverable wifi/wifi_ap_client non-kitsune-foxes/fm_fox; do pushd "${challenge}" > /dev/null 2>&1 printf "Rolling %s for %s... " "${challenge}" "${conf}" - if [ -x make_conference.sh ]; then - ./make_conference.sh "${requested_conf}" + if [ -x make_conference ]; then + ./make_conference "${requested_conf}" if [ ! -e "src/conferences/${conf}.h" ]; then printf "Something went wrong creating %s/src/conferences/%s.h, please scroll up\n" "${challenge}" "${conf}" exit 1 diff --git a/non-kitsune-foxes/README.md b/non-kitsune-foxes/README.md index fcafcfe..cb50d77 100644 --- a/non-kitsune-foxes/README.md +++ b/non-kitsune-foxes/README.md @@ -1 +1 @@ -This folder is full of pretend stubs so that make_conference.sh will create flags and directions for foxes we use for the RF CTF which are not actually part of kitsune. +This folder is full of pretend stubs so that `make_conference` will create flags and directions for foxes we use for the RF CTF which are not actually part of kitsune. diff --git a/qa/build-test-skel b/qa/build-test-skel index e855bc9..6e64492 100755 --- a/qa/build-test-skel +++ b/qa/build-test-skel @@ -6,7 +6,7 @@ python3 -m pip install -U platformio sudo apt-get install cracklib-runtime -y ## Create a new conference from 9999skel -./make_conference_full.sh github-ci +./make_conference_full github-ci ## Verify is worked if [ ! -r "$(date +"%Y")github-ci.txt" ]; then printf "Report file missing\n" diff --git a/switch_conference b/switch_conference new file mode 100755 index 0000000..04191fb --- /dev/null +++ b/switch_conference @@ -0,0 +1,28 @@ +#!/bin/bash +set -e +set -u + +# Ensure we have a conference name +if [ -n "${1:-}" ]; then + conf="${1}" +else + printf "Please provide conference name\n" + exit 1 +fi + +# Check if that conference name already exists +for challenge in bluetooth/iBeacon bluetooth/classic_discoverable wifi/wifi_ap_client; do + pushd "${challenge}" > /dev/null 2>&1 + if [ ! -e "src/conferences/${conf}.h" ]; then + printf "%s/src/conferences/%s.h does not exist, unable to switch to this conference\n" "${challenge}" "${conf}" + exit 1 + fi + popd > /dev/null 2>&1 +done + +for challenge in bluetooth/iBeacon bluetooth/classic_discoverable wifi/wifi_ap_client; do + pushd "${challenge}" > /dev/null 2>&1 + ln -snf "conferences/${conf}.h" src/current_conf.h + popd > /dev/null 2>&1 +done +printf "Switched to %s\n" "${conf}" diff --git a/wifi/wifi_ap_client/make_conference.sh b/wifi/wifi_ap_client/make_conference similarity index 100% rename from wifi/wifi_ap_client/make_conference.sh rename to wifi/wifi_ap_client/make_conference