#/bin/bash
file=$1

startline=$(grep -n "add_pm_script()" "$file" | cut -d: -f1 |head -1)
endline=$(grep -n 'chmod 0755 $COREDIR/suspend.sh' "$file" | cut -d: -f1 |head -1)

source <(
	tail -n +$startline $file | head -n +$(($endline - $startline)) &&
	echo "}" # close the function op
)
COREDIR=$(mktemp -d)
add_pm_script "systemd"

cat "$COREDIR/suspend.sh"

rm -rf "$COREDIR"

#/bin/bash
file=$1

startline=$(grep -n "add_pm_script()" "$file" | cut -d: -f1 |head -1)
endline=$(grep -n 'chmod 0755 $COREDIR/suspend.sh' "$file" | cut -d: -f1 |head -1)

source <(
	tail -n +$startline $file | head -n +$(($endline - $startline)) &&
	echo "}" # close the function op
)
COREDIR=$(mktemp -d)
add_pm_script "systemd"

sed -i -e '1 s/^.*$/\#!\/usr\/bin\/bash/' "$COREDIR/suspend.sh"

cat "$COREDIR/suspend.sh"

rm -rf "$COREDIR"

Remove need to mangle shebang in displaylink.sh sleep script
Remove need to mangle shebang in displaylink.sh sleep script

It would appear that while in Fedora 30+ the rpmbuild has been able to
handle the mangling of the shebang from '#!/bin/bash' to
'#!/usr/bin/bash', the build for Fedora 33 is err'ing out.  This is an
attempt to correct this.
