Add placeholder hooks to simplify user migrations
Without those, every sxmo_migrate.sh ask the user if they want to remove those. Adding a placeholder make it easy to differenciate known hooks, and hooks that has been removed. This also cleanup, merge or fix some existing hooks.
This commit is contained in:
8
configs/default_hooks/sxmo_hook_power.sh
Normal file
8
configs/default_hooks/sxmo_hook_power.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# This script is executed before reboot and poweroff the system
|
||||
#
|
||||
# The following parameters are provided:
|
||||
# $1 = Action (poweroff or reboot)
|
@@ -3,7 +3,7 @@
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# Allow user to override what we log in the sms.txt file. Note if you change
|
||||
# this you probably should change sxmo_hook_parselog.sh
|
||||
# this you probably should change sxmo_hook_tailtextlog.sh
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
|
@@ -48,4 +48,3 @@ CONTACTSSEDCMD="$(mkcontactssedcmd)"
|
||||
|
||||
sxmo_terminal.sh sh -c "tail -n9999 -f \"$SXMO_LOGDIR/$LOGDIRNUM/sms.txt\" |\
|
||||
sed -e \"$CONTACTSSEDCMD\" -e \"$DATESEDCMD\" -e \"$COLORSEDCMD\""
|
||||
#sxmo_terminal.sh sh -c "sxmo_hook_parselog.sh \"$NUMBER\""
|
||||
|
@@ -575,8 +575,8 @@ If your phone has a wifi killswitch (like the Pinephone or Librem 5), make sure
|
||||
|
||||
HOOKS: _sxmo_hook_network_up.sh_ (what to do when network goes up),
|
||||
_sxmo_hook_network_down.sh_ (what to do when network goes down),
|
||||
_sxmo_hook_network_preup.sh_,
|
||||
_sxmo_hook_network_predown.sh_
|
||||
_sxmo_hook_network_pre_up.sh_,
|
||||
_sxmo_hook_network_pre_down.sh_
|
||||
|
||||
# AUDIO
|
||||
|
||||
|
@@ -11,12 +11,12 @@ usage() {
|
||||
|
||||
case "$1" in
|
||||
reboot)
|
||||
sxmo_hook_reboot.sh
|
||||
sxmo_hook_power.sh reboot
|
||||
sxmo_daemons.sh stop all
|
||||
doas reboot
|
||||
;;
|
||||
poweroff)
|
||||
sxmo_hook_poweroff.sh
|
||||
sxmo_hook_power.sh poweroff
|
||||
sxmo_daemons.sh stop all
|
||||
doas poweroff
|
||||
;;
|
||||
|
Reference in New Issue
Block a user