Browse code

Fixed bash entry in /etc/shells

Change-Id: I1b53dd4328f6a3aab4c5ff4541681a91dfbb0297
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2042
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: suezzelur <anishs@vmware.com>

dthaluru authored on 2017/02/03 03:23:30
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Bourne-Again SHell
2 2
 Name:		bash
3 3
 Version:	4.3.30
4
-Release:	5%{?dist}
4
+Release:	6%{?dist}
5 5
 License:	GPLv3
6 6
 URL:		http://www.gnu.org/software/bash/
7 7
 Group:		System Environment/Base
... ...
@@ -226,18 +226,21 @@ if [ $1 -eq 1 ] ; then
226 226
         cp /etc/skel/.bash_logout /root/.bash_logout
227 227
     fi
228 228
     if [ ! -f /etc/shells ]; then
229
-        echo "%{_bindir}/bash" >> /etc/shells
229
+        echo "/bin/bash" >> /etc/shells
230 230
     else
231
-        grep -q '^%{_bindir}/bash$' /etc/shells || \
232
-        echo "%{_bindir}/bash" >> /etc/shells
231
+        grep -q '^/bin/bash$' /etc/shells || \
232
+        echo "/bin/bash" >> /etc/shells
233 233
     fi
234 234
 fi
235 235
 if [ $1 -eq 2 ] ; then
236 236
     if [ ! -f /etc/shells ]; then
237
-        echo "%{_bindir}/bash" >> /etc/shells
237
+        echo "/bin/bash" >> /etc/shells
238 238
     else
239
-        grep -q '^%{_bindir}/bash$' /etc/shells || \
240
-        echo "%{_bindir}/bash" >> /etc/shells
239
+        grep -v '^%{_bindir}/bash$'  /etc/shells | \
240
+        grep -v '^%{_bindir}/bash$' > /etc/shells.rpm && \
241
+        mv /etc/shells.rpm /etc/shells
242
+        grep -q '^/bin/bash$' /etc/shells || \
243
+        echo "/bin/bash" >> /etc/shells
241 244
     fi
242 245
 fi
243 246
 
... ...
@@ -246,9 +249,9 @@ if [ $1 -eq 0 ] ; then
246 246
     if [ -f "/root/.bash_logout" ] ; then
247 247
         rm -f /root/.bash_logout
248 248
     fi
249
-    if [ ! -x %{_bindir}/bash ]; then
250
-        grep -v '^%{_bindir}/bash$'  /etc/shells | \
251
-        grep -v '^%{_bindir}/bash$' > /etc/shells.rpm && \
249
+    if [ ! -x /bin/bash ]; then
250
+        grep -v '^/bin/bash$'  /etc/shells | \
251
+        grep -v '^/bin/bash$' > /etc/shells.rpm && \
252 252
         mv /etc/shells.rpm /etc/shells
253 253
     fi
254 254
 fi
... ...
@@ -265,6 +268,8 @@ fi
265 265
 %defattr(-,root,root)
266 266
 
267 267
 %changelog
268
+*   Thu Feb 2 2017 Divya Thaluru <dthaluru@vmware.com>  4.3.30-6
269
+-   Modified bash entry in /etc/shells
268 270
 *   Tue Jan 10 2017 Divya Thaluru <dthaluru@vmware.com>  4.3.30-5
269 271
 -   Added bash entry to /etc/shells
270 272
 *	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.3.30-4