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" BROADCAST_BIN="tmux_broadcast.sh"
function install_tmuxviewer () { 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" echo "adding $VIEWER_BIN and $BROADCAST_BIN to $BIN_FOLDER"
sudo cp $SCRIPT_DIR$VIEWER_BIN $BIN_FOLDER$VIEWER_BIN cp $SCRIPT_DIR$VIEWER_BIN $BIN_FOLDER$VIEWER_BIN
sudo cp $SCRIPT_DIR$BROADCAST_BIN $BIN_FOLDER$BROADCAST_BIN cp $SCRIPT_DIR$BROADCAST_BIN $BIN_FOLDER$BROADCAST_BIN
echo "adding user $VIEWER" 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" echo "unsetting password for $VIEWER"
sudo passwd -d $VIEWER 1> /dev/null passwd -d $VIEWER 1> /dev/null
sudo mkdir -p $SSHD_CONFIG_FOLDER mkdir -p $SSHD_CONFIG_FOLDER
sudo echo -e "Match User $VIEWER\n\tPermitEmptyPasswords yes" > $CONFIG_FILE_PATH echo -e "Match User $VIEWER\n\tPermitEmptyPasswords yes" > $CONFIG_FILE_PATH
#sudo systemctl restart sshd.service #sudo systemctl restart sshd.service
} }
function uninstall_tmuxviewer () { function uninstall_tmuxviewer () {
echo "removing user $VIEWER" echo "removing user $VIEWER"
sudo userdel $VIEWER userdel $VIEWER
sudo rm $CONFIG_FILE_PATH rm $CONFIG_FILE_PATH
sudo rm $BIN_FOLDER$VIEWER_BIN rm $BIN_FOLDER$VIEWER_BIN
sudo rm $BIN_FOLDER$BROADCAST_BIN rm $BIN_FOLDER$BROADCAST_BIN
} }
case $1 in case $1 in