forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
many: make shell scripts shellcheck-clean
Also make run-checks run shellcheck on the data completion scripts as well as on tests/lib/*.sh. Includes making pinentry-fake.sh an actual script (so shellcheck can check it too) instead of a here-document inside another one.
- Loading branch information
Showing
21 changed files
with
190 additions
and
160 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!bash | ||
#!/bin/bash | ||
|
||
bootenv() { | ||
if [ $# -eq 0 ]; then | ||
if command -v grub-editenv >/dev/null; then | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
change_id() { | ||
# takes <summary pattern> [<status>] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
|
||
# Default applies for: Ubuntu, Debian | ||
SNAPMOUNTDIR=/snap | ||
LIBEXECDIR=/usr/lib | ||
export SNAPMOUNTDIR=/snap | ||
export LIBEXECDIR=/usr/lib |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,5 @@ | ||
#!/bin/sh | ||
echo "setup fake gpg pinentry environment" | ||
cat > /tmp/pinentry-fake <<'EOF' | ||
#!/bin/sh | ||
set -e | ||
echo "OK Pleased to meet you" | ||
while true; do | ||
read line | ||
case $line in | ||
GETPIN) | ||
echo "D pass" | ||
echo "OK" | ||
;; | ||
BYE) | ||
exit 0 | ||
;; | ||
*) | ||
echo "OK I'm not very smart" | ||
;; | ||
esac | ||
done | ||
EOF | ||
chmod +x /tmp/pinentry-fake | ||
mkdir -pm 0700 $HOME/.snap/gnupg/ | ||
echo pinentry-program /tmp/pinentry-fake > $HOME/.snap/gnupg/gpg-agent.conf | ||
mkdir -p ~/.snap/gnupg/ | ||
echo pinentry-program "$TESTSLIB/pinentry-fake.sh" > ~/.snap/gnupg/gpg-agent.conf | ||
chmod -R go-rwx ~/.snap |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
get_default_iface(){ | ||
echo "$(ip route get 8.8.8.8 | awk '{ print $5; exit }')" | ||
ip route get 8.8.8.8 | awk '{ print $5; exit }' | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -e | ||
echo "OK Pleased to meet you" | ||
while true; do | ||
read -r line | ||
case $line in | ||
GETPIN) | ||
echo "D pass" | ||
echo "OK" | ||
;; | ||
BYE) | ||
exit 0 | ||
;; | ||
*) | ||
echo "OK I'm not very smart" | ||
;; | ||
esac | ||
done |
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
Oops, something went wrong.