-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzram.is
executable file
·59 lines (50 loc) · 1.05 KB
/
zram.is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
### BEGIN INIT INFO
# Provides: zram
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Use compressed RAM as in-memory swap
# Description: Use compressed RAM as in-memory swap
### END INIT INFO
# script settings
# service name
ZRAM_SERVICE=zram
zrs_start () {
echo "${ZRAM_SERVICE} starting"
placeholder/sbin/zram.sh activate
}
zrs_stop () {
echo "${ZRAM_SERVICE} stopping"
placeholder/sbin/zram.sh deactivate
}
_stat_() {
placeholder/sbin/zram.sh status
}
zrs_restart () {
echo "${ZRAM_SERVICE} restarting"
zrs_stop
sleep 2
zrs_start
}
case "$1" in
start|init)
zrs_start
;;
stop|end)
zrs_stop
;;
status)
_stat_
;;
reload|restart|force-restart|force-reload)
zrs_restart
;;
*)
printf '%s\n' "Usage:"
printf '\t%s %s\n' "$0" "{ start | stop | restart | reload | status }"
exit 1
;;
esac
# End of file