Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bunny_helper switch position #4

Merged
merged 2 commits into from
Mar 7, 2017
Merged

Conversation

kevthehermit
Copy link
Contributor

Allows you to use $switchposition in payloads. Useful for building paths relative to payload/

@IMcPwn
Copy link
Contributor

IMcPwn commented Mar 4, 2017

@kevthehermit Shouldn't it follow the format of the other variables of all caps?
SWITCH_POSITION perhaps?

@IMcPwn
Copy link
Contributor

IMcPwn commented Mar 4, 2017

You added a whole different module. You might want to rebase everything that isn't in bunny_helpers.sh.

@kevthehermit
Copy link
Contributor Author

Yeah just spotted that after i pushed the commit.

switch3=`cat /sys/class/gpio_sw/PL3/data`
echo "--- switch1 = $switch1, switch2 = $switch2, switch3 = $switch3"
if [ "x$switch1" = "x0" ] && [ "x$switch2" = "x1" ] && [ "x$switch3" = "x1" ]; then
SWITCH_POSITION="switch1"
Copy link
Contributor

@IMcPwn IMcPwn Mar 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the export be done here?

if [ "x$switch1" = "x0" ] && [ "x$switch2" = "x1" ] && [ "x$switch3" = "x1" ]; then
SWITCH_POSITION="switch1"
elif [ "x$switch1" = "x1" ] && [ "x$switch2" = "x0" ] && [ "x$switch3" = "x1" ]; then
SWITCH_POSITION="switch2"
Copy link
Contributor

@IMcPwn IMcPwn Mar 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here... etc. instead of at the bottom because wouldn't the bottom one just reset the variable to blank?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants