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"
|
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
|
||||||
|
|
Loading…
Reference in New Issue