lazy/run.sh
2023-11-30 14:30:48 +08:00

31 lines
628 B
Bash
Executable File

#!/bin/sh
if [ "$1" = "command" ]; then
echo "Please run the following command to install lazy:"
echo "sh -c \"\$(wget -qO- cc.c-4.cc/lazy.sh)\""
exit 0
fi
scriptdir=$(dirname $(realpath $0))
# ============================================================
git -C $scriptdir pull
$scriptdir/update.sh
if [ "$1" = "update" ]; then
exit 0
fi
if [ "$(id -u)" -eq 0 ]; then
echo "Running in root mode."
$scriptdir/init_root.sh $@
elif [ "$(sudo id -u)" -eq 0 ]; then
echo "Running in sudo mode."
$scriptdir/init_sudo.sh $@
else
echo "Running in user mode."
$scriptdir/init_user.sh $@
fi