Skip to content

Commit

Permalink
Merge pull request #155 from MirServer/fix-daemon
Browse files Browse the repository at this point in the history
snap: use `snapctl model` to determine if Classic
  • Loading branch information
AlanGriffiths authored Oct 12, 2023
2 parents 1f19a32 + eac842d commit 0b39a08
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 0b39a08

Please sign in to comment.