You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
427 B

#!/bin/bash
file=$1
startline=$(grep -n "add_pm_script()" "$file" | cut -d: -f1 | head -1)
endline=$(grep -n 'chmod 0755 /etc/zzz.d/resume/displaylink.sh' "$file" | cut -d: -f1 | head -1)
source <(
tail -n +$startline $file | head -n +$(($endline - $startline + 5))
)
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"