From 8747402d7647d02d85f513cdd9d32410a6e17db6 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Thu, 9 May 2024 17:41:10 -0500 Subject: xsync; disallow root --- local/bin/xsync | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'local') diff --git a/local/bin/xsync b/local/bin/xsync index a298633..c6108ae 100755 --- a/local/bin/xsync +++ b/local/bin/xsync @@ -8,10 +8,14 @@ # Add whatever package you want to install, and run xsync to sync your # list of packages with the new list -set -e +usr=$(whoami) +if [ $usr = "root" ] + then echo "Xsync run as root; please do not run privileged" + exit 1 +fi xpkg -m | sort > /tmp/xsync-installed -cat ~/repository.list | sort > /tmp/xsync-spec +cat $HOME/repository.list | sort > /tmp/xsync-spec comm /tmp/xsync-spec /tmp/xsync-installed -23 > /tmp/xsync-to-install comm /tmp/xsync-spec /tmp/xsync-installed -13 > /tmp/xsync-to-remove -- cgit v1.2.3