Skip to content

Commit

Permalink
scripts/pkg.in: prevent pkg command from being run as root
Browse files Browse the repository at this point in the history
  • Loading branch information
Damaj301damaj-lol authored and agnostic-apollo committed Feb 2, 2023
1 parent 51c3694 commit e38ee51
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/pkg.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash
set -eu

# Root Check
if [[ "$(id -u)" == "0" ]]; then
echo "Error: Cannot run 'pkg' command as root"
exit 1
fi

# Setup TERMUX_APP_PACKAGE_MANAGER
source "@TERMUX_PREFIX@/bin/termux-setup-package-manager" || exit 1

Expand Down

0 comments on commit e38ee51

Please sign in to comment.