removes sudo for install
This commit is contained in:
parent
94c425b419
commit
114c647c25
22
install.sh
22
install.sh
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue