Skip to content

Instantly share code, notes, and snippets.

@rnkn
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnkn/c8b45543f167312b6ce6 to your computer and use it in GitHub Desktop.
Save rnkn/c8b45543f167312b6ce6 to your computer and use it in GitHub Desktop.
txtdir.net script for adding friends links
#! /bin/sh
usage="Usage: addfriend friend1 [friend2 ...]"
friendsdir=$HOME/public/friends
if [ ! -d $friendsdir ]
then
echo "Making friends directory..."
mkdir -pv $friendsdir
fi
if [ $# > 0 ]
then
echo "Linking friends..."
for friend in $@
do
if [ $(id -un $friend) ]
then
ln -shv $WORLD/$friend $friendsdir/$friend
fi
done
else
echo $usage
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment