Skip to content

Commit

Permalink
snap: use snapctl model to determine if Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
Saviq committed Oct 12, 2023
1 parent 1f19a32 commit eac842d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions snap/hooks/install
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ snapctl stop --disable "$SNAP_INSTANCE_NAME.daemon"
daemon=$(snapctl get daemon)
if [ "$daemon" = "" ]
then
if grep -q -e snap_core= -e snapd_recovery_mode= /proc/cmdline
then snapctl set daemon=true
else snapctl set daemon=false
# if no model at all, it's either classic or something is wrong
if ! snapctl model > /dev/null || [ "$( snapctl model | awk '/^classic:/ { print $2 }' )" == "true" ]
then snapctl set daemon=false
else snapctl set daemon=true
fi
fi

0 comments on commit eac842d

Please sign in to comment.