Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface_status.sh to add entry for each sessions #1751

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.service $FILESYSTEM_ROOT/et
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable interfaces-config.service
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.sh $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
sudo cp $IMAGE_CONFIGS/interfaces/interface_mode.sh $FILESYSTEM_ROOT/etc/profile.d/

# Copy initial interfaces configuration file, will be overwritten on first boot
sudo cp $IMAGE_CONFIGS/interfaces/init_interfaces $FILESYSTEM_ROOT/etc/network
Expand Down
1 change: 1 addition & 0 deletions files/image_config/environment/environment
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VTYSH_PAGER=more
SONIC_CLI_IFACE_MODE=default
14 changes: 14 additions & 0 deletions files/image_config/interfaces/interface_mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pts=$(tty | cut -d '/' -f4)

#For console session
if [ -z "$pts" ]; then
pts=$(tty | cut -d '/' -f3 | cut -d 'S' -f2)
fi

filename="pts"$pts".cfg"

#remove stale entries
rm -rf /tmp/pts$pts.cfg

#Create unique file entry for each tty
echo "interface_mode=DEFAULT" > /tmp/$filename
2 changes: 2 additions & 0 deletions files/image_config/sudoers/sudoers
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Defaults env_reset
#Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults env_keep += "VTYSH_PAGER"
Defaults lecture_file = /etc/sudoers.lecture
Defaults env_keep += "SONIC_CLI_IFACE_MODE"

# Host alias specification

Expand Down