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.
18 lines
427 B
18 lines
427 B
2 years ago
|
#!/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"
|