removes sudo for install

This commit is contained in:
waldek 2022-03-23 13:01:26 +01:00
parent 94c425b419
commit 114c647c25
1 changed files with 11 additions and 11 deletions

View File

@ -15,25 +15,25 @@ VIEWER_BIN="tmux_viewer.sh"
BROADCAST_BIN="tmux_broadcast.sh"
function install_tmuxviewer () {
sudo apt install -y tmux openssh-server
apt-get install -y tmux openssh-server
echo "adding $VIEWER_BIN and $BROADCAST_BIN to $BIN_FOLDER"
sudo cp $SCRIPT_DIR$VIEWER_BIN $BIN_FOLDER$VIEWER_BIN
sudo cp $SCRIPT_DIR$BROADCAST_BIN $BIN_FOLDER$BROADCAST_BIN
cp $SCRIPT_DIR$VIEWER_BIN $BIN_FOLDER$VIEWER_BIN
cp $SCRIPT_DIR$BROADCAST_BIN $BIN_FOLDER$BROADCAST_BIN
echo "adding user $VIEWER"
sudo useradd --home /tmp/$VIEWER --shell /usr/bin/tmux_viewer.sh $VIEWER
useradd --home /tmp/$VIEWER --shell /usr/bin/tmux_viewer.sh $VIEWER
echo "unsetting password for $VIEWER"
sudo passwd -d $VIEWER 1> /dev/null
sudo mkdir -p $SSHD_CONFIG_FOLDER
sudo echo -e "Match User $VIEWER\n\tPermitEmptyPasswords yes" > $CONFIG_FILE_PATH
passwd -d $VIEWER 1> /dev/null
mkdir -p $SSHD_CONFIG_FOLDER
echo -e "Match User $VIEWER\n\tPermitEmptyPasswords yes" > $CONFIG_FILE_PATH
#sudo systemctl restart sshd.service
}
function uninstall_tmuxviewer () {
echo "removing user $VIEWER"
sudo userdel $VIEWER
sudo rm $CONFIG_FILE_PATH
sudo rm $BIN_FOLDER$VIEWER_BIN
sudo rm $BIN_FOLDER$BROADCAST_BIN
userdel $VIEWER
rm $CONFIG_FILE_PATH
rm $BIN_FOLDER$VIEWER_BIN
rm $BIN_FOLDER$BROADCAST_BIN
}
case $1 in