File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ Arguments:
48
48
is supplied it will search for that
49
49
-u [VERSION] Uninstall the specified kernel version. If version is omitted,
50
50
a list of max 10 installed kernel versions is displayed
51
+ --update Update this script by redownloading it from github
51
52
-h Show this message
52
53
53
54
Optional:
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ sign_kernel=0
12
12
mokKey=" /var/lib/shim-signed/mok/MOK-Kernel.priv"
13
13
mokCert=" /var/lib/shim-signed/mok/MOK-Kernel.pem"
14
14
15
+ self_update_url=" https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh"
16
+
15
17
# If quiet=1 then no log messages are printed (except errors)
16
18
quiet=0
17
19
@@ -241,6 +243,9 @@ while (( "$#" )); do
241
243
debug_target=" /dev/stderr"
242
244
quiet=0
243
245
;;
246
+ --update)
247
+ run_action=" update"
248
+ ;;
244
249
-h|--help)
245
250
run_action=" help"
246
251
;;
@@ -463,6 +468,7 @@ Arguments:
463
468
is supplied it will search for that
464
469
-u [VERSION] Uninstall the specified kernel version. If version is omitted,
465
470
a list of max 10 installed kernel versions is displayed
471
+ --update Update this script by redownloading it from github
466
472
-h Show this message
467
473
468
474
Optional:
@@ -482,7 +488,21 @@ Optional:
482
488
"
483
489
exit 2
484
490
;;
491
+ update)
492
+ check_environment
493
+
494
+ self=" $( readlink -f " $0 " ) "
495
+ $wget -q -O " $self .tmp" " $self_update_url "
485
496
497
+ if [ ! -s " $self .tmp" ]; then
498
+ rm " $self .tmp"
499
+ err " Update failed, downloaded file is empty"
500
+ exit 1
501
+ else
502
+ mv " $self .tmp" " $self "
503
+ echo " Script updated"
504
+ fi
505
+ ;;
486
506
check)
487
507
check_environment
488
508
You can’t perform that action at this time.
0 commit comments