| Server IP : 94.16.115.136 / Your IP : 216.73.217.106 Web Server : Apache/2.4.52 (Ubuntu) System : Linux rogerrabbit 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 User : bkillingseder ( 1001) PHP Version : 8.1.2-1ubuntu2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /snap/core22/current/usr/libexec/core/ |
Upload File : |
#!/bin/sh
# Usage:
# get-mode entry-name /path/to/modeenv
#
# get-mode will look for entry-name in modeenv files and return 0 if
# found, 1 if not found. It will print the value to stdout.
set -eu
if [ "$#" -gt 2 ]; then
echo "Too many arguments" 1>&2
exit 1
fi
if [ "$#" -lt 1 ]; then
echo "Expected a name as argument" 1>&2
exit 1
fi
name="${1}"
modeenv="${2:-/var/lib/snapd/modeenv}"
while read -r line; do
case "${line}" in
"${name}"=*)
echo "${line#*=}"
exit 0
;;
*)
;;
esac
done <"${modeenv}"
exit 1