Compare commits
No commits in common. "54c7b0952490a7c787ecace745227970c78a1c46" and "a745f5f98f518abef0f3cc9edb64a09e5729de77" have entirely different histories.
54c7b09524
...
a745f5f98f
2 changed files with 16 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
||||
# 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"
|
||||
|
||||
[[ -z "$reboot" ]] && exit 0
|
||||
[[ ! "$reboot" ]] && exit 0
|
||||
|
||||
timeout="5"
|
||||
printf ""$font_colored"> rebooting system in "
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
||||
# license: MIT
|
||||
|
@ -8,11 +8,20 @@ distro="$(grep "^ID" /etc/*release | cut -d "=" -f2)"
|
|||
script="$(dirname $(realpath $0))/$distro.sh"
|
||||
|
||||
# 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
|
||||
if [[ "$(id -u)" -eq 0 ]] || [[ "$distro" == "arch" ]]; then
|
||||
"$script" $@
|
||||
#if [ "$distro" == "arch" ]; then
|
||||
# "$script" $args
|
||||
if [ "$(id -u)" -eq 0 ] || [ "$distro" == "arch" ]; then
|
||||
#elif [ "$(id -u)" -eq 0 ]; then
|
||||
"$script" $args
|
||||
else
|
||||
sudo "$script" $@
|
||||
sudo "$script" $args
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue