Compare commits
3 commits
a745f5f98f
...
54c7b09524
Author | SHA1 | Date | |
---|---|---|---|
54c7b09524 | |||
6d0919cb6f | |||
3ea5eee6bc |
2 changed files with 7 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
||||||
# license: MIT
|
# license: MIT
|
||||||
|
@ -39,7 +39,7 @@ printf ""$font_colored"> removing orphaned packages..."$font_default"\n"
|
||||||
|
|
||||||
printf ""$font_colored_bold">> system updated finished after "$SECONDS" seconds!"$font_default"\n"
|
printf ""$font_colored_bold">> system updated finished after "$SECONDS" seconds!"$font_default"\n"
|
||||||
|
|
||||||
[[ ! "$reboot" ]] && exit 0
|
[[ -z "$reboot" ]] && exit 0
|
||||||
|
|
||||||
timeout="5"
|
timeout="5"
|
||||||
printf ""$font_colored"> rebooting system in "
|
printf ""$font_colored"> rebooting system in "
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
||||||
# license: MIT
|
# license: MIT
|
||||||
|
@ -8,20 +8,11 @@ distro="$(grep "^ID" /etc/*release | cut -d "=" -f2)"
|
||||||
script="$(dirname $(realpath $0))/$distro.sh"
|
script="$(dirname $(realpath $0))/$distro.sh"
|
||||||
|
|
||||||
# check if update script exists
|
# check if update script exists
|
||||||
[ ! -x "$script" ] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1
|
[[ ! -x "$script" ]] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1
|
||||||
|
|
||||||
args=""
|
|
||||||
for arg in "$@"; do
|
|
||||||
[ -n "$args" ] && args="$args "
|
|
||||||
args="$args$arg"
|
|
||||||
done
|
|
||||||
|
|
||||||
# execute update script
|
# execute update script
|
||||||
#if [ "$distro" == "arch" ]; then
|
if [[ "$(id -u)" -eq 0 ]] || [[ "$distro" == "arch" ]]; then
|
||||||
# "$script" $args
|
"$script" $@
|
||||||
if [ "$(id -u)" -eq 0 ] || [ "$distro" == "arch" ]; then
|
|
||||||
#elif [ "$(id -u)" -eq 0 ]; then
|
|
||||||
"$script" $args
|
|
||||||
else
|
else
|
||||||
sudo "$script" $args
|
sudo "$script" $@
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue