File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ Arguments:
4848 is supplied it will search for that
4949 -u [VERSION] Uninstall the specified kernel version. If version is omitted,
5050 a list of max 10 installed kernel versions is displayed
51+ --update Update this script by redownloading it from github
5152 -h Show this message
5253
5354Optional:
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ sign_kernel=0
1212mokKey=" /var/lib/shim-signed/mok/MOK-Kernel.priv"
1313mokCert=" /var/lib/shim-signed/mok/MOK-Kernel.pem"
1414
15+ self_update_url=" https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh"
16+
1517# If quiet=1 then no log messages are printed (except errors)
1618quiet=0
1719
@@ -241,6 +243,9 @@ while (( "$#" )); do
241243 debug_target=" /dev/stderr"
242244 quiet=0
243245 ;;
246+ --update)
247+ run_action=" update"
248+ ;;
244249 -h|--help)
245250 run_action=" help"
246251 ;;
@@ -463,6 +468,7 @@ Arguments:
463468 is supplied it will search for that
464469 -u [VERSION] Uninstall the specified kernel version. If version is omitted,
465470 a list of max 10 installed kernel versions is displayed
471+ --update Update this script by redownloading it from github
466472 -h Show this message
467473
468474Optional:
@@ -482,7 +488,21 @@ Optional:
482488"
483489 exit 2
484490 ;;
491+ update)
492+ check_environment
493+
494+ self=" $( readlink -f " $0 " ) "
495+ $wget -q -O " $self .tmp" " $self_update_url "
485496
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+ ;;
486506 check)
487507 check_environment
488508
You can’t perform that action at this time.
0 commit comments