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

hooks/configure: drop unused verify_int() #164

Merged
merged 4 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lxd-migrate/scripts/upgrade-bridge
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e
#!/bin/sh
set -e
# Work from the snap
export PATH=/snap/bin/:${PATH}
export LANG=C.UTF-8
Expand Down
16 changes: 2 additions & 14 deletions snapcraft/hooks/configure
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -eu
#!/bin/sh
set -eu

# Re-exec outside of apparmor confinement
if [ -d /sys/kernel/security/apparmor ] && [ "$(cat /proc/self/attr/current)" != "unconfined" ]; then
Expand Down Expand Up @@ -29,19 +30,6 @@ get_bool() {
return
}

verify_int () {
value="${1:-}"

# Verify if the value is a positive integer
if echo "${value}" | grep -Eq '^[0-9]+$'; then
echo "${value}"
return
fi

# Invalid value (or not set)
return
}

# Don't fail if the mount namespace isn't properly setup yet
if [ ! -e /run/snapd-snap.socket ]; then
exit 0
Expand Down
3 changes: 2 additions & 1 deletion snapcraft/hooks/install
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -eu
#!/bin/sh
set -eu

# Create paths needed by the units
mkdir -p "${SNAP_COMMON}/lxd"
Expand Down