~speguero/systemd-autohibernated

ref: v0.1 systemd-autohibernated/install -rwxr-xr-x 643 bytes
5693d269 — Steven Peguero Language enhancement in install script a year ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

dpath_script="$(dirname "$0")"

if uname -s | grep -q 'Linux' && which systemd > /dev/null 2>&1 && which python3 > /dev/null 2>&1
then
	cp -vf "$dpath_script/systemd-autohibernated" /usr/local/bin/systemd-autohibernated
	chown 0:0 /usr/local/bin/systemd-autohibernated
	chmod u=rwx,go=rx /usr/local/bin/systemd-autohibernated

	cp -vf "$dpath_script/systemd-autohibernated.service" /etc/systemd/system/systemd-autohibernated.service
	systemctl enable systemd-autohibernated.service
	systemctl start systemd-autohibernated.service
else
	printf "> error: This software requires a systemd-based Linux distribution with Python 3.\n"
fi