File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 2
2
# Copyright (c) 2023 rM-self-serve
3
3
# SPDX-License-Identifier: MIT
4
4
5
- webinterface_onboot_sha256sum=' edad550010f408ede2d85f723174735a19e9ffa12ffa31330a3b772e339ed841 '
5
+ webinterface_onboot_sha256sum=' 8795ecb9bdd18b84deab0efa1a96c08ff53559d65567babb0088400da44daf0f '
6
6
service_file_sha256sum=' 64cfdd5c8eaea1bc8df2e734a41c7ff038585cc2f4248c79e50531901b1ef651'
7
7
8
- release=' v1.2.1 '
8
+ release=' v1.2.2 '
9
9
10
10
installfile=' ./install-webint-ob.sh'
11
11
pkgname=' webinterface-onboot'
Original file line number Diff line number Diff line change @@ -38,15 +38,19 @@ main() {
38
38
run
39
39
;;
40
40
' apply-hack' )
41
+ checkspace
41
42
apply_hack
42
43
;;
43
44
' revert-hack' )
45
+ checkspace
44
46
revert_hack
45
47
;;
46
48
' apply-prstip' )
49
+ checkspace
47
50
apply_prstip
48
51
;;
49
52
' revert-prstip' )
53
+ checkspace
50
54
revert_prstip
51
55
;;
52
56
' is-hack-applied' )
@@ -96,6 +100,36 @@ cli_info() {
96
100
echo ' -h, --help Show help'
97
101
}
98
102
103
+ checkspace () {
104
+ if ! _checkspace / 1; then
105
+ (
106
+ echo " Not enough space on /"
107
+ echo " Try to free space by running: journalctl --vacuum-time=1m"
108
+ echo " Or: systemctl restart xochitl"
109
+ exit 10
110
+ )
111
+ exit 1
112
+ fi
113
+ if ! _checkspace /home 12; then
114
+ (
115
+ echo " Not enough space on /home"
116
+ exit 10
117
+ )
118
+ exit 1
119
+ fi
120
+ }
121
+
122
+ _checkspace () {
123
+ part=$1
124
+ needed=$2
125
+ _available=$( df " $part " | tail -n1 | awk ' {print $4}' )
126
+ available=$(( "$_available " / 1024 ))
127
+ if [ $available -lt " $needed " ]; then
128
+ echo " Less than ${needed} MB free, ${available} MB"
129
+ return 1
130
+ fi
131
+ }
132
+
99
133
run_vars () {
100
134
user_conf=' /home/root/.config/remarkable/xochitl.conf'
101
135
usb0iprange=' 10.11.99.1/32'
You can’t perform that action at this time.
0 commit comments