diff options
author | Danny Rawlins <monster.romster@gmail.com> | 2020-01-04 12:44:18 +1100 |
---|---|---|
committer | Danny Rawlins <monster.romster@gmail.com> | 2020-01-04 12:52:01 +1100 |
commit | 911cf65f0dd2fffcc8c5dfec5aca88e69895cb01 (patch) | |
tree | a0d5ade31df3c1c5e06652d560a8e5532819df54 /ffmpegfs/pre-install | |
parent | 4c68b99574b75f36ce7a147fc8af358131beace4 (diff) | |
download | contrib-911cf65f0dd2fffcc8c5dfec5aca88e69895cb01.tar.gz contrib-911cf65f0dd2fffcc8c5dfec5aca88e69895cb01.tar.xz |
ffmpegfs: 1.8 -> 1.9
Diffstat (limited to 'ffmpegfs/pre-install')
-rwxr-xr-x | ffmpegfs/pre-install | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ffmpegfs/pre-install b/ffmpegfs/pre-install new file mode 100755 index 000000000..67489c92c --- /dev/null +++ b/ffmpegfs/pre-install @@ -0,0 +1,42 @@ +#!/bin/sh + +# Created by Danny Rawlins, <crux at romster dot me> + +GROUP=ffmpegfs +USER=ffmpegfs +USER_COMMENT="FUSE-based transcoding filesystem" +USER_HOME=/var/empty +USER_SHELL=/bin/sh + +if [ ! $(id -u) = 0 ]; then + echo "ERROR: you need to be root to run this!" + exit 1 +fi + +if [ $GROUP ]; then + if ! getent group $GROUP > /dev/null; then + /usr/sbin/groupadd $GROUP + if [ $? -eq 0 ]; then + echo "Group: $GROUP added." + fi + else + echo "Group: $GROUP already exists! Skipping." + fi +fi + +if ! getent passwd $USER > /dev/null; then + /usr/sbin/useradd -g $GROUP -c "$USER_COMMENT" -d $USER_HOME -s $USER_SHELL $USER + if [ $? -eq 0 ]; then + echo "User: $USER added." + /usr/bin/passwd -l $USER > /dev/null + if [ $? -eq 0 ]; then + echo "Locked: $USER account." + fi + else + echo "ERROR: unable to lock $USER account." + /usr/sbin/userdel $USER + fi + else + echo "User: $USER already exists! Skipping." +fi + |